Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux²Ù×÷ϵͳϵĶàÏ̱߳à³ÌÏêϸ½âÎö£¨4£©


   º¯ÊýÔ­ÐÍ£º
   
#include <pthread.h>
void pthread_cleanup_push(void (*rtn)(void *),void *arg);
    º¯ÊýrtnÊÇÇåÀíº¯Êý£¬argÊǵ÷ÓòÎÊý
void pthread_cleanup_pop(int execute);
 
 
    ÔÚÇ°Ãæ½²¹ýÏ̵߳ÄÖÕÖ¹·½Ê½£¬ÊÇÕý³£ÖÕÖ¹»¹ÊÇ·ÇÕý³£ÖÕÖ¹£¬¶¼»á´æÔÚÒ»¸ö×ÊÔ´ÊͷŵÄÎÊÌ⣬ÔÚposixÖÐÌṩÁËÒ»×飬¾ÍÊÇÎÒÃÇÉÏÃæ¿´µÄº¯Êý½øÐÐÏß³ÌÍ˳öµÄ´¦Àíº¯Êý£¬ÓÐЩÏñÔÚ½ø³ÌÖеÄatexitº¯Êý¡£Êͷŵķ½Ê½ÊÇÖ¸pthread_cleanup_pushµÄµ÷Óõ㵽pthread_cleanup_popÖ®¼ä³ÌÐò¶Î½øÐÐÖÕÖ¹¡£
    pthread_cleanup_push()/pthread_cleanup_pop²ÉÓÃÏÈÈëºó³öµÄ·½Ê½µÄÕ»µÄ¹ÜÀí·½Ê½£¬void *rtn(void *),ÔÚÖ´ÐÐpthread_cleanup_push()ʱѹÈ뺯ÊýÕ»£¬¶à´ÎÖ´ÐÐpthread_cleanup_push()ÐγÉÒ»¸öº¯ÊýÁ´£¬ÔÚÖ´ÐÐÕâ¸öº¯ÊýÁ´µÄʱºò»áÒÔ·´·½Ïòµ¯³ö£¬¼´ÏÈÈëºó³ö¡£execute²ÎÊý±íʶ£¬ÊÇ·ñÖ´Ðе¯³öÇåÀíº¯Êý£¬µ±execute=0ʱ²»½øÐе¯³öÇåÀíº¯Êý£¬·ÇÁãµÄʱºòµ¯³ö´¦Àíº¯Êý¡£
    Àý³Ì9
    ³ÌÐòÄ¿µÄ£ºÊµÏÖÔÚÕý³£½áÊøÏ̵߳Äʱºò£¬½øÐк¯Êý´¦Àí
    ³ÌÐòÃû³Æ£ºpthread_clean.c
 /********************************************************************************************
**    Name:pthread_clean.c
**    Used to study the multithread programming in Linux OS
**    A example showing a thread to be cleaned.
**    Author:zeickey
**    Date:2008/6/28       
**    Copyright (c) 2006,All Rights Reserved!
*********************************************************************************************/
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void *clean(void *arg)
{
    printf("cleanup :%s  \n",(char *)arg);
    return (void *)0;
}
void *thr_fn1(void *arg)
{
    printf("thread 1 start  \n");
    pthread_cleanup_push( (void*)clean,"thread 1 first handler");
    pthread_cleanup_push( (void*)clean,"thread


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈЭÒé ......

ǶÈëʽLinuxϲÊÉ«LCDÇý¶¯µÄÉè¼ÆÓëʵÏÖ

ǶÈëʽLinuxϲÊÉ«LCDÇý¶¯µÄÉè¼ÆÓëʵÏÖ
ÕªÒª£º±¾ÎĽéÉÜÁËÈçºÎÔÚǶÈëÔÚ¿ª·¢²ÊÉ«LCDÏÔʾÇý¶¯µÄ·½·¨£¬²¢¶ÔLinuxÖеÄÏÔʾÇý¶¯³ÌÐò½á¹¹ºÍ¿ò¼Ü×÷Ò»½éÉÜ¡£
    ³¤ÆÚÒÔÀ´£¬ÔÚ³£¼ûµÄÕÆÉϵçÄÔ£¨PDA£©µÈСÐÍÊÖ³ÖʽÉ豸ÉÏ£¬ÓÉÓÚÓ²¼þÌõ¼þµÈµÄÏÞÖÆ£¬ÎÒÃÇ¿´µ½µÄÏÔʾÆ÷¼þͨ³£Êǵ¥É«LCD£¬Óû§½çÃæÒ²·Ç³£¼òµ¥£¬¼¸ºõ¿´²»µ½ PC ......

Linux USBÇý¶¯¿ò¼Ü·ÖÎö(ת£©

Linux USBÇý¶¯¿ò¼Ü·ÖÎö£¨Ò»£©
    ³õ´Î½Ó´¥ÓëOSÏà¹ØµÄÉ豸Çý¶¯±àд£¬¸Ð¾õ»¹Í¦ÓÐÒâ˼µÄ£¬ÎªÁ˲»ÖÁÓÚÍüµô¿´¹ýµÄ¶«Î÷£¬±Ê¼Ç¸ú×ܽᵱȻ²»¿Éȱ£¬¸üºÎ¿öÎÒ¾ö¶¨ÎªÇ¶ÈëʽÂôÃüÁË¡£ºÃ£¬ÑÔ¹éÕý´«£¬ÎÒ˵һ˵Õâ¶Îʱ¼äµÄÊÕ»ñ£¬¸ú´ó¼Ò·ÖÏíÒ»ÏÂLinuxµÄÇý¶¯¿ª·¢¡£µ«Õâ´ÎÖ»ÏÈÕë¶ÔLinuxµÄUSB×Óϵͳ×÷·ÖÎö£¬ÒòΪÖÜÎåÑÐÌÖÀÏ°å´ß» ......

linux c oci Ô¶³ÌÁ¬½ÓÀý×Ó

ÒÔÏÂÊÇÎҵIJâÊÔociµÄÀý×Ó£¡
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "oci.h"
static OCIServer        *srvhp;
static OCISession       *p_session;
static OCIEnv    &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ