亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? threads.sgml

?? GLIB-C的最新源代碼
?? SGML
?? 第 1 頁 / 共 4 頁
字號:
</para>@name: the name of the lock.<!-- ##### MACRO G_LOCK ##### --><para>Works like g_mutex_lock(), but for a lock defined with #G_LOCK_DEFINE.</para>@name: the name of the lock.<!-- ##### MACRO G_TRYLOCK ##### --><para>Works like g_mutex_trylock(), but for a lock defined with #G_LOCK_DEFINE.</para>@name: the name of the lock.@Returns: %TRUE, if the lock could be locked.<!-- ##### MACRO G_UNLOCK ##### --><para>Works like g_mutex_unlock(), but for a lock defined with #G_LOCK_DEFINE.</para>@name: the name of the lock.<!-- ##### STRUCT GStaticRecMutex ##### --><para>A #GStaticRecMutex works like a #GStaticMutex, but it can be lockedmultiple times by one thread. If you enter it n times, you have tounlock it n times again to let other threads lock it. An exception isthe function g_static_rec_mutex_unlock_full(): that allows you tounlock a #GStaticRecMutex completely returning the depth, (i.e. thenumber of times this mutex was locked). The depth can later be used torestore the state of the #GStaticRecMutex by callingg_static_rec_mutex_lock_full().</para><para>Even though #GStaticRecMutex is not opaque, it should only be used withthe following functions.</para><para>All of the <function>g_static_rec_mutex_*</function> functions canbe used even if g_thread_init() has not been called.</para><!-- ##### MACRO G_STATIC_REC_MUTEX_INIT ##### --><para>A #GStaticRecMutex must be initialized with this macro before it canbe used. This macro can used be to initialize a variable, but itcannot be assigned to a variable. In that case you have to useg_static_rec_mutex_init().</para><para><informalexample><programlisting>GStaticRecMutex my_mutex = G_STATIC_REC_MUTEX_INIT;</programlisting></informalexample></para><!-- ##### FUNCTION g_static_rec_mutex_init ##### --><para>A #GStaticRecMutex must be initialized with this function before itcan be used. Alternatively you can initialize it with#G_STATIC_REC_MUTEX_INIT.</para>@mutex: a #GStaticRecMutex to be initialized.<!-- ##### FUNCTION g_static_rec_mutex_lock ##### --><para>Locks @mutex. If @mutex is already locked by another thread, thecurrent thread will block until @mutex is unlocked by the otherthread. If @mutex is already locked by the calling thread, thisfunctions increases the depth of @mutex and returns immediately.</para>@mutex: a #GStaticRecMutex to lock.<!-- ##### FUNCTION g_static_rec_mutex_trylock ##### --><para>Tries to lock @mutex. If @mutex is already locked by another thread,it immediately returns %FALSE. Otherwise it locks @mutex and returns%TRUE. If @mutex is already locked by the calling thread, thisfunctions increases the depth of @mutex and immediately  returns %TRUE.</para>@mutex: a #GStaticRecMutex to lock.@Returns: %TRUE, if @mutex could be locked.<!-- ##### FUNCTION g_static_rec_mutex_unlock ##### --><para>Unlocks @mutex. Another thread can will be allowed to lock @mutex onlywhen it has been unlocked as many times as it had been lockedbefore. If @mutex is completely unlocked and another thread is blockedin a g_static_rec_mutex_lock() call for @mutex, it will be woken andcan lock @mutex itself.</para>@mutex: a #GStaticRecMutex to unlock.<!-- ##### FUNCTION g_static_rec_mutex_lock_full ##### --><para>Works like calling g_static_rec_mutex_lock() for @mutex @depth times.</para>@mutex: a #GStaticRecMutex to lock.@depth: number of times this mutex has to be unlocked to be completely unlocked.<!-- ##### FUNCTION g_static_rec_mutex_unlock_full ##### --><para>Completely unlocks @mutex. If another thread is blocked in ag_static_rec_mutex_lock() call for @mutex, it will be woken and canlock @mutex itself. This function returns the number of times that@mutex has been locked by the current thread. To restore the statebefore the call to g_static_rec_mutex_unlock_full() you can callg_static_rec_mutex_lock_full() with the depth returned by thisfunction.</para>@mutex: a #GStaticRecMutex to completely unlock.@Returns: number of times @mutex has been locked by the current thread.<!-- ##### FUNCTION g_static_rec_mutex_free ##### --><para>Releases all resources allocated to a #GStaticRecMutex.</para><para>You don't have to call this functions for a #GStaticRecMutex with anunbounded lifetime, i.e. objects declared 'static', but if you have a#GStaticRecMutex as a member of a structure and the structure isfreed, you should also free the #GStaticRecMutex.</para>@mutex: a #GStaticRecMutex to be freed.<!-- ##### STRUCT GStaticRWLock ##### --><para>The #GStaticRWLock struct represents a read-write lock. A read-writelock can be used for protecting data that some portions of code onlyread from, while others also write. In such situations it isdesirable that several readers can read at once, whereas of courseonly one writer may write at a time. Take a look at the followingexample:<example><title>An array with access functions</title><programlisting>  GStaticRWLock rwlock = G_STATIC_RW_LOCK_INIT;  GPtrArray *array;  gpointer my_array_get (guint index)  {    gpointer retval = NULL;    if (!array)      return NULL;    g_static_rw_lock_reader_lock (&amp;rwlock);    if (index &lt; array->len)      retval = g_ptr_array_index (array, index);    g_static_rw_lock_reader_unlock (&amp;rwlock);    return retval;  }  void my_array_set (guint index, gpointer data)  {    g_static_rw_lock_writer_lock (&amp;rwlock);    if (!array)      array = g_ptr_array_new (<!-- -->);    if (index >= array->len)      g_ptr_array_set_size (array, index+1);    g_ptr_array_index (array, index) = data;     g_static_rw_lock_writer_unlock (&amp;rwlock);  }</programlisting></example></para><para>This example shows an array which can be accessed by many readers(the <function>my_array_get()</function> function) simultaneously, whereas the writers (the <function>my_array_set()</function> function) will only be allowed once at a time and only if no readers currently access the array. This is because of the potentially dangerous resizing of the array. Using these functions is fully multi-thread safe now. </para><para>Most of the time, writers should have precedence over readers. Thatmeans, for this implementation, that as soon as a writer wants to lockthe data, no other reader is allowed to lock the data, whereas, ofcourse, the readers that already have locked the data are allowed tofinish their operation. As soon as the last reader unlocks the data,the writer will lock it.</para><para>Even though #GStaticRWLock is not opaque, it should only be used withthe following functions.</para><para>All of the <function>g_static_rw_lock_*</function> functions can be used even if g_thread_init() has not been called.</para><note><para>A read-write lock has a higher overhead than a mutex. For example, bothg_static_rw_lock_reader_lock() and g_static_rw_lock_reader_unlock()have to lock and unlock a #GStaticMutex, so it takes at least twice thetime to lock and unlock a #GStaticRWLock that it does to lock and unlock a#GStaticMutex. So only data structures that are accessed by multiplereaders, and which keep the lock for a considerable time justify a#GStaticRWLock. The above example most probably would fare better witha #GStaticMutex.</para></note><!-- ##### MACRO G_STATIC_RW_LOCK_INIT ##### --><para>A #GStaticRWLock must be initialized with this macro before it canbe used. This macro can used be to initialize a variable, but itcannot be assigned to a variable. In that case you have to useg_static_rw_lock_init().</para><para><informalexample><programlisting>GStaticRWLock my_lock = G_STATIC_RW_LOCK_INIT;</programlisting></informalexample></para><!-- ##### FUNCTION g_static_rw_lock_init ##### --><para>A #GStaticRWLock must be initialized with this function before it canbe used. Alternatively you can initialize it with#G_STATIC_RW_LOCK_INIT.</para>@lock: a #GStaticRWLock to be initialized.<!-- ##### FUNCTION g_static_rw_lock_reader_lock ##### --><para>Locks @lock for reading. There may be unlimited concurrent locks forreading of a #GStaticRWLock at the same time.  If @lock is alreadylocked for writing by another thread or if another thread is alreadywaiting to lock @lock for writing, this function will block until@lock is unlocked by the other writing thread and no other writingthreads want to lock @lock. This lock has to be unlocked byg_static_rw_lock_reader_unlock().</para><para>#GStaticRWLock is not recursive. It might seem to be possible torecursively lock for reading, but that can result in a deadlock, dueto writer preference.</para>@lock: a #GStaticRWLock to lock for reading.<!-- ##### FUNCTION g_static_rw_lock_reader_trylock ##### --><para>Tries to lock @lock for reading. If @lock is already locked forwriting by another thread or if another thread is already waiting tolock @lock for writing, immediately returns %FALSE. Otherwise locks@lock for reading and returns %TRUE. This lock has to be unlocked byg_static_rw_lock_reader_unlock().</para>@lock: a #GStaticRWLock to lock for reading.@Returns: %TRUE, if @lock could be locked for reading.<!-- ##### FUNCTION g_static_rw_lock_reader_unlock ##### --><para>Unlocks @lock. If a thread waits to lock @lock for writing and alllocks for reading have been unlocked, the waiting thread is woken upand can lock @lock for writing.</para>@lock: a #GStaticRWLock to unlock after reading.<!-- ##### FUNCTION g_static_rw_lock_writer_lock ##### --><para>Locks @lock for writing. If @lock is already locked for writing orreading by other threads, this function will block until @lock iscompletely unlocked and then lock @lock for writing. While thisfunctions waits to lock @lock, no other thread can lock @lock forreading. When @lock is locked for writing, no other thread can lock@lock (neither for reading nor writing). This lock has to be unlockedby g_static_rw_lock_writer_unlock().</para>@lock: a #GStaticRWLock to lock for writing.<!-- ##### FUNCTION g_static_rw_lock_writer_trylock ##### --><para>Tries to lock @lock for writing. If @lock is already locked (foreither reading or writing) by another thread, it immediately returns%FALSE. Otherwise it locks @lock for writing and returns %TRUE. Thislock has to be unlocked by g_static_rw_lock_writer_unlock().</para>@lock: a #GStaticRWLock to lock for writing.@Returns: %TRUE, if @lock could be locked for writing.<!-- ##### FUNCTION g_static_rw_lock_writer_unlock ##### --><para>Unlocks @lock. If a thread is waiting to lock @lock for writing andall locks for reading have been unlocked, the waiting thread is wokenup and can lock @lock for writing. If no thread is waiting to lock@lock for writing, and some thread or threads are waiting to lock @lockfor reading, the waiting threads are woken up and can lock @lock forreading.</para>@lock: a #GStaticRWLock to unlock after writing.<!-- ##### FUNCTION g_static_rw_lock_free ##### --><para>Releases all resources allocated to @lock. </para><para>You don't have to call this functions for a #GStaticRWLock with anunbounded lifetime, i.e. objects declared 'static', but if you have a#GStaticRWLock as a member of a structure, and the structure is freed,you should also free the #GStaticRWLock.</para>@lock: a #GStaticRWLock to be freed.<!-- ##### STRUCT GCond ##### --><para>The #GCond struct is an opaque data structure that represents acondition. Threads can block on a #GCond if they find a certaincondition to be false. If other threads change the state of thiscondition they signal the #GCond, and that causes the waiting threadsto be woken up.</para><para><example><title>Using GCond to block a thread until a condition is satisfied</title><programlisting>GCond* data_cond = NULL;   /* Must be initialized somewhere */GMutex* data_mutex = NULL; /* Must be initialized somewhere */gpointer current_data = NULL;void push_data (gpointer data){  g_mutex_lock (data_mutex);  current_data = data;  g_cond_signal (data_cond);  g_mutex_unlock (data_mutex);}gpointer pop_data (<!-- -->){  gpointer data;  g_mutex_lock (data_mutex);  while (!current_data)      g_cond_wait (data_cond, data_mutex);  data = current_data;  current_data = NULL;  g_mutex_unlock (data_mutex);  return data;}</programlisting></example></para><para>Whenever a thread calls <function>pop_data()</function> now, it will wait until current_data is non-%NULL, i.e. until some other thread has called <function>push_data()</function>.</para><note><para>It is important to use the g_cond_wait() and g_cond_timed_wait()functions only inside a loop which checks for the condition to be

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美韩日一区二区三区四区| 成人午夜激情在线| 日本伊人精品一区二区三区观看方式| 自拍偷拍亚洲综合| 亚洲天堂精品视频| 亚洲精品高清视频在线观看| 一区二区三区四区乱视频| 亚洲另类一区二区| 亚洲国产毛片aaaaa无费看 | 日韩一区有码在线| 亚洲欧美综合另类在线卡通| **欧美大码日韩| 一区二区在线观看免费视频播放 | av日韩在线网站| 色婷婷国产精品久久包臀| 欧美专区亚洲专区| 欧美绝品在线观看成人午夜影视| 91麻豆精品国产91久久久更新时间 | 成人性色生活片免费看爆迷你毛片| 国产91精品一区二区麻豆网站| 成人午夜av在线| 色偷偷一区二区三区| 欧美日韩在线播放| 欧美tk—视频vk| 国产精品理论在线观看| 依依成人综合视频| 日韩黄色片在线观看| 国产一区欧美日韩| 91农村精品一区二区在线| 欧美日韩精品欧美日韩精品| 欧美tickling网站挠脚心| 中文字幕免费不卡| 亚洲成国产人片在线观看| 精品一区二区三区视频在线观看| 成人综合在线视频| 欧美美女黄视频| 国产偷国产偷精品高清尤物| 亚洲三级免费电影| 男女男精品视频网| 99久久精品国产网站| 欧美一区二区日韩一区二区| 久久免费美女视频| 亚洲国产美女搞黄色| 精品制服美女丁香| 色老综合老女人久久久| 精品不卡在线视频| 一区二区三区四区在线播放| 激情综合色综合久久| 色哟哟在线观看一区二区三区| 在线播放欧美女士性生活| 国产精品免费久久| 麻豆中文一区二区| 在线观看一区日韩| 国产欧美日韩精品在线| 日韩av在线播放中文字幕| 成人激情视频网站| 日韩无一区二区| 伊人开心综合网| 床上的激情91.| 日韩欧美国产综合| 亚洲成人在线观看视频| 成人丝袜18视频在线观看| 91麻豆精品国产91久久久使用方法| 中文字幕一区二区三中文字幕| 日韩 欧美一区二区三区| 色天使色偷偷av一区二区| 久久久777精品电影网影网| 五月天久久比比资源色| 色综合久久久久久久| 国产欧美精品区一区二区三区| 日韩国产精品久久久| 91传媒视频在线播放| 日韩一区有码在线| 大美女一区二区三区| 欧美电视剧在线看免费| 日韩高清不卡一区二区| 欧美性感一类影片在线播放| 中文在线资源观看网站视频免费不卡| 久久国产日韩欧美精品| 欧美日韩视频在线第一区| 亚洲精品免费在线播放| av男人天堂一区| 国产精品久久免费看| 国产盗摄女厕一区二区三区| 日韩欧美成人一区二区| 婷婷久久综合九色综合伊人色| 色一情一伦一子一伦一区| 综合久久久久久| av午夜一区麻豆| 国产精品久久久久久久久图文区| 国产成人av一区| 久久精品视频一区二区三区| 国内精品伊人久久久久av影院| 欧美电视剧在线看免费| 麻豆精品在线播放| 日韩欧美国产综合| 久久99国内精品| 精品国产91洋老外米糕| 极品尤物av久久免费看| 欧美精品一区二区三区很污很色的| 日本vs亚洲vs韩国一区三区二区 | 欧美电影免费观看高清完整版在 | 久久色在线观看| 精品一区中文字幕| 精品国产欧美一区二区| 国产一区二区三区蝌蚪| 国产亚洲精品精华液| 成人午夜视频网站| |精品福利一区二区三区| 99久久久久久| 一区二区成人在线观看| 欧美午夜一区二区三区免费大片| 亚洲午夜免费电影| 欧美一区二区三区免费在线看| 美脚の诱脚舐め脚责91| 久久综合久久综合九色| 成人精品国产一区二区4080| 国产欧美综合色| 91猫先生在线| 午夜视频久久久久久| 日韩欧美国产一二三区| 国产99精品国产| 亚洲女爱视频在线| 91精品国产色综合久久不卡电影| 久久综合综合久久综合| 欧美国产在线观看| 99久久精品免费| 日韩不卡免费视频| 久久久久久久一区| 色先锋aa成人| 美女爽到高潮91| 中文欧美字幕免费| 欧美性生交片4| 久久成人综合网| 日韩一区欧美小说| 91精品国产综合久久精品性色 | 懂色av中文一区二区三区| 亚洲伦在线观看| 日韩女优av电影| 91一区二区三区在线播放| 日韩在线一区二区| 久久色在线视频| 在线观看亚洲a| 黑人精品欧美一区二区蜜桃| 亚洲色图视频网| 精品久久久网站| 一本久道中文字幕精品亚洲嫩| 免费不卡在线视频| 亚洲三级电影网站| 亚洲精品一区二区三区影院| 一本色道久久综合亚洲aⅴ蜜桃| 蜜桃视频一区二区三区| **欧美大码日韩| 亚洲精品在线三区| 91视频www| 国产精品456露脸| 日韩黄色在线观看| 亚洲日本在线观看| 久久美女高清视频| 777奇米成人网| 91在线免费视频观看| 国模大尺度一区二区三区| 亚洲国产精品一区二区久久恐怖片| 欧美精品一区二区三区高清aⅴ | 日韩欧美一级精品久久| 99久久er热在这里只有精品66| 蜜乳av一区二区| 亚洲资源中文字幕| 国产精品久久久久久福利一牛影视 | 色欲综合视频天天天| 国产一区三区三区| 日产欧产美韩系列久久99| 一区二区三区四区精品在线视频| 国产日韩欧美一区二区三区综合| 777精品伊人久久久久大香线蕉| 91原创在线视频| 色哦色哦哦色天天综合| 国产成人精品亚洲日本在线桃色 | 亚洲成av人综合在线观看| 中文字幕一区二区三区精华液| 26uuu另类欧美| 日韩三级av在线播放| 精品1区2区3区| 在线观看91视频| 99国产精品一区| 粉嫩av亚洲一区二区图片| 韩国成人在线视频| 久久精品99久久久| 日韩精品国产精品| 日韩在线观看一区二区| 亚洲国产一区二区三区青草影视| 中文字幕一区二区三区精华液 | 国产精品资源在线观看| 久久精品国产亚洲高清剧情介绍| 午夜精品成人在线视频| 午夜欧美在线一二页| 亚洲国产一二三| 亚洲一区二区五区| 亚洲444eee在线观看| 图片区小说区国产精品视频|