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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? threads.sgml

?? This GTK+ version 2.12.3. GTK+ is a multi-platform toolkit for creating graphical user interfaces.
?? SGML
字號:
<!-- ##### SECTION Title ##### -->Threads<!-- ##### SECTION Short_Description ##### -->Functions for using GDK in multi-threaded programs<!-- ##### SECTION Long_Description ##### --><para>For thread safety, GDK relies on the thread primitives in GLib, and on the thread-safe GLib main loop.</para><para>GLib is completely thread safe (all global data is automatically locked), but individual data structure instances are not automatically locked for performance reasons. So e.g. you must coordinate accesses to the same #GHashTable from multiple threads.</para><para>GTK+ is "thread aware" but not thread safe &mdash; it provides aglobal lock controlled by gdk_threads_enter()/gdk_threads_leave()which protects all use of GTK+. That is, only one thread can use GTK+ at any given time.</para><para>Unfortunately the above holds with the X11 backend only. With theWin32 backend, GDK calls should not be attempted from multiple threadsat all.</para><para>You must call g_thread_init() and gdk_threads_init() before executingany other GTK+ or GDK functions in a threaded GTK+ program.</para><para>Idles, timeouts, and input functions from GLib, such as g_idle_add(), areexecuted outside of the main GTK+ lock.So, if you need to call GTK+ inside of such a callback, you must surroundthe callback with a gdk_threads_enter()/gdk_threads_leave() pair or usegdk_threads_add_idle_full() which does this for you.However, event dispatching from the mainloop is still executed withinthe main GTK+ lock, so callback functions connected to event signalslike GtkWidget::button-press-event, do not need thread protection.</para><para>In particular, this means, if you are writing widgets that might be used in threaded programs, you <emphasis>must</emphasis> surround timeouts and idle functions in this matter.</para><para>As always, you must also surround any calls to GTK+ not made within a signal handler with a gdk_threads_enter()/gdk_threads_leave() pair.</para><para>Before calling gdk_threads_leave() from a thread otherthan your main thread, you probably want to call gdk_flush()to send all pending commands to the windowing system.(The reason you don't need to do this from the main threadis that GDK always automatically flushes pending commandswhen it runs out of incoming events to process and hasto sleep while waiting for more events.)</para><para>A minimal main program for a threaded GTK+ applicationlooks like:</para><informalexample><programlisting role="C">intmain (int argc, char *argv[]){  GtkWidget *window;  g_thread_init (NULL);  gdk_threads_init (<!-- -->);  gdk_threads_enter (<!-- -->);  gtk_init (&amp;argc, &amp;argv);  window = create_window (<!-- -->);  gtk_widget_show (window);  gtk_main (<!-- -->);  gdk_threads_leave (<!-- -->);  return 0;}</programlisting></informalexample><para>Callbacks require a bit of attention. Callbacks from GTK+ signalsare made within the GTK+ lock. However callbacks from GLib (timeouts,IO callbacks, and idle functions) are made outside of the GTK+lock. So, within a signal handler you do not need to callgdk_threads_enter(), but within the other types of callbacks, youdo.</para><para>Erik Mouw contributed the following code example toillustrate how to use threads within GTK+ programs.</para><informalexample><programlisting role="C">/*------------------------------------------------------------------------- * Filename:      gtk-thread.c * Version:       0.99.1 * Copyright:     Copyright (C) 1999, Erik Mouw * Author:        Erik Mouw &lt;J.A.K.Mouw@its.tudelft.nl&gt; * Description:   GTK threads example.  * Created at:    Sun Oct 17 21:27:09 1999 * Modified by:   Erik Mouw &lt;J.A.K.Mouw@its.tudelft.nl&gt; * Modified at:   Sun Oct 24 17:21:41 1999 *-----------------------------------------------------------------------*//* * Compile with: * * cc -o gtk-thread gtk-thread.c `gtk-config --cflags --libs gthread` * * Thanks to Sebastian Wilhelmi and Owen Taylor for pointing out some * bugs. * */&num;include &lt;stdio.h&gt;&num;include &lt;stdlib.h&gt;&num;include &lt;unistd.h&gt;&num;include &lt;time.h&gt;&num;include &lt;gtk/gtk.h&gt;&num;include &lt;glib.h&gt;&num;include &lt;pthread.h&gt;&num;define YES_IT_IS    (1)&num;define NO_IT_IS_NOT (0)typedef struct {  GtkWidget *label;  int what;} yes_or_no_args;G_LOCK_DEFINE_STATIC (yes_or_no);static volatile int yes_or_no = YES_IT_IS;void destroy (GtkWidget *widget, gpointer data){  gtk_main_quit (<!-- -->);}void *argument_thread (void *args){  yes_or_no_args *data = (yes_or_no_args *)args;  gboolean say_something;  for (;;)    {      /* sleep a while */      sleep(rand(<!-- -->) / (RAND_MAX / 3) + 1);      /* lock the yes_or_no_variable */      G_LOCK(yes_or_no);      /* do we have to say something? */      say_something = (yes_or_no != data->what);      if(say_something)	{	  /* set the variable */	  yes_or_no = data->what;	}      /* Unlock the yes_or_no variable */      G_UNLOCK (yes_or_no);      if (say_something)	{	  /* get GTK thread lock */	  gdk_threads_enter (<!-- -->);	  /* set label text */	  if(data->what == YES_IT_IS)	    gtk_label_set_text (GTK_LABEL (data->label), "O yes, it is!");	  else	    gtk_label_set_text (GTK_LABEL (data->label), "O no, it isn't!");	  /* release GTK thread lock */	  gdk_threads_leave (<!-- -->);	}    }  return NULL;}int main (int argc, char *argv[]){  GtkWidget *window;  GtkWidget *label;  yes_or_no_args yes_args, no_args;  pthread_t no_tid, yes_tid;  /* init threads */  g_thread_init (NULL);  gdk_threads_init (<!-- -->);  gdk_threads_enter (<!-- -->);  /* init gtk */  gtk_init(&amp;argc, &amp;argv);  /* init random number generator */  srand ((unsigned int) time (NULL));  /* create a window */  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);  gtk_signal_connect (GTK_OBJECT (window), "destroy",		      GTK_SIGNAL_FUNC (destroy), NULL);  gtk_container_set_border_width (GTK_CONTAINER (window), 10);  /* create a label */  label = gtk_label_new ("And now for something completely different ...");  gtk_container_add (GTK_CONTAINER (window), label);    /* show everything */  gtk_widget_show (label);  gtk_widget_show (window);  /* create the threads */  yes_args.label = label;  yes_args.what = YES_IT_IS;  pthread_create (&amp;yes_tid, NULL, argument_thread, &amp;yes_args);  no_args.label = label;  no_args.what = NO_IT_IS_NOT;  pthread_create (&amp;no_tid, NULL, argument_thread, &amp;no_args);  /* enter the GTK main loop */  gtk_main (<!-- -->);  gdk_threads_leave (<!-- -->);  return 0;}</programlisting></informalexample><!-- ##### SECTION See_Also ##### --><para></para><!-- ##### SECTION Stability_Level ##### --><!-- ##### MACRO GDK_THREADS_ENTER ##### --><para>This macro marks the beginning of a critical section in which GDK andGTK+ functions can be called safely and without causing raceconditions.  Only one thread at a time can be in such a critialsection. The macro expands to a no-op if #G_THREADS_ENABLED has notbeen defined. Typically gdk_threads_enter() should be used instead ofthis macro.</para><!-- ##### MACRO GDK_THREADS_LEAVE ##### --><para>This macro marks the end of a critical section begun with #GDK_THREADS_ENTER.</para><!-- ##### FUNCTION gdk_threads_init ##### --><para></para><!-- ##### FUNCTION gdk_threads_enter ##### --><para>This macro marks the beginning of a critical section in which GDK andGTK+ functions can be called safely and without causing raceconditions.  Only one thread at a time can be in such a critialsection.</para><!-- ##### FUNCTION gdk_threads_leave ##### --><para>Leaves a critical region begun with gdk_threads_enter(). </para><!-- ##### VARIABLE gdk_threads_mutex ##### --><para>The #GMutex used to implement the critical region forgdk_threads_enter()/gdk_threads_leave(). </para><!-- ##### FUNCTION gdk_threads_set_lock_functions ##### --><para></para>@enter_fn: @leave_fn: <!-- ##### FUNCTION gdk_threads_add_idle ##### --><para></para>@function: @data: @Returns: <!-- ##### FUNCTION gdk_threads_add_idle_full ##### --><para></para>@priority: @function: @data: @notify: @Returns: <!-- ##### FUNCTION gdk_threads_add_timeout ##### --><para></para>@interval: @function: @data: @Returns: <!-- ##### FUNCTION gdk_threads_add_timeout_full ##### --><para></para>@priority: @interval: @function: @data: @notify: @Returns: 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合色狠狠综合色| 国产精品理论片在线观看| 欧美丝袜自拍制服另类| 北条麻妃一区二区三区| 成人综合婷婷国产精品久久蜜臀| 国产成人日日夜夜| 国产成人精品免费| 粉嫩久久99精品久久久久久夜| 国产精品69毛片高清亚洲| 国产麻豆精品95视频| 国产福利视频一区二区三区| 国产精一区二区三区| 成人免费毛片a| 色欲综合视频天天天| 欧美日韩一区二区在线视频| 欧美日本一区二区三区四区| 91.麻豆视频| 精品国产免费人成电影在线观看四季| 久久综合给合久久狠狠狠97色69| 久久久亚洲综合| 国产精品久久久久久久久搜平片| 一区二区中文字幕在线| 一区二区三区四区视频精品免费| 午夜一区二区三区在线观看| 久久精品国产99国产精品| 国产乱码字幕精品高清av | 精品一二线国产| 国产成人免费视频网站| 不卡视频一二三四| 欧美日韩综合在线免费观看| 欧美一区二区三区在线视频| 国产亲近乱来精品视频| 一区二区三区四区中文字幕| 日本午夜精品视频在线观看| 国产曰批免费观看久久久| av电影一区二区| 欧美日韩免费不卡视频一区二区三区| 日韩女同互慰一区二区| 国产精品久久午夜夜伦鲁鲁| 五月婷婷久久丁香| 国产精品资源在线| 91黄色在线观看| 欧美大片日本大片免费观看| 国产精品视频第一区| 午夜电影一区二区三区| 国产高清久久久| 欧美日韩第一区日日骚| 国产精品午夜春色av| 偷拍一区二区三区四区| 大尺度一区二区| 91麻豆精品久久久久蜜臀| 国产精品天天摸av网| 亚洲福利一区二区| 成人短视频下载| 欧美一区二区成人| 亚洲私人影院在线观看| 久久爱另类一区二区小说| 色综合久久综合网| 国产亚洲精久久久久久| 婷婷综合五月天| av电影一区二区| 久久免费国产精品| 日本在线不卡视频一二三区| 成人福利视频在线看| 日韩欧美电影一区| 一区二区激情视频| 国产999精品久久| 日韩欧美一级精品久久| 亚洲激情图片小说视频| 成人黄页在线观看| 日韩你懂的在线观看| 亚洲成年人网站在线观看| av爱爱亚洲一区| 国产色产综合产在线视频| 日韩va欧美va亚洲va久久| 色综合天天综合在线视频| 国产亚洲欧美日韩日本| 毛片不卡一区二区| 欧美性三三影院| 亚洲裸体在线观看| 大白屁股一区二区视频| 久久精品视频网| 久久成人免费网| 日韩一区二区三区免费观看 | av不卡在线观看| 国产三级精品三级| 久久99精品国产麻豆婷婷洗澡| 欧美日韩亚洲国产综合| 一区二区三区四区乱视频| 91小视频在线观看| 1024成人网| 成人av免费网站| 欧美国产精品一区二区| 国产乱人伦偷精品视频免下载| 精品久久久久久亚洲综合网 | 91香蕉视频mp4| 国产精品家庭影院| av亚洲精华国产精华精| 国产精品亲子伦对白| 国产不卡视频一区二区三区| 久久新电视剧免费观看| 国产剧情一区二区三区| 久久精品免费在线观看| 国产美女一区二区| 国产欧美日韩不卡| 国产成人av网站| 欧美精彩视频一区二区三区| 国产成人免费视频一区| 国产精品久久久久aaaa| 99精品欧美一区二区三区小说| 国产精品你懂的在线欣赏| 国产成人av资源| 国产精品久久久久久久岛一牛影视 | 久久久久久黄色| 成人一区二区三区视频在线观看 | 一区二区三区欧美日韩| 欧美色中文字幕| 麻豆91在线看| 欧美精品一区二区高清在线观看| 国产一区二区在线免费观看| 久久久久国产精品人| av亚洲精华国产精华| 亚洲一区二区成人在线观看| 欧美一区午夜视频在线观看| 免费观看日韩电影| 久久亚洲综合色| 99精品国产91久久久久久| 亚洲影院久久精品| 日韩美女视频在线| 成人高清免费观看| 亚洲高清不卡在线观看| 欧美mv日韩mv| 色综合 综合色| 伦理电影国产精品| 国产精品成人在线观看| 欧美日韩国产美女| 国产精品影视网| 一区二区在线观看不卡| 日韩一区二区在线观看视频播放| 国产精选一区二区三区| 亚洲精品v日韩精品| 日韩欧美成人午夜| 99精品国产视频| 蜜臀av一区二区在线免费观看| 欧美国产日韩亚洲一区| 欧美写真视频网站| 国产精品影音先锋| 午夜精品免费在线观看| 久久精品免视看| 8v天堂国产在线一区二区| 国产一区二区不卡在线| 亚洲精品自拍动漫在线| 日韩欧美一二区| 色综合天天综合网国产成人综合天| 亚洲国产另类av| 国产精品午夜久久| 日韩三级在线观看| 一本到三区不卡视频| 韩国一区二区视频| 一个色综合网站| 国产午夜精品在线观看| 欧美日韩久久不卡| 97精品国产露脸对白| 国产真实乱对白精彩久久| 一区二区激情视频| 亚洲国产激情av| 欧美一区二区三区视频在线观看| 9色porny自拍视频一区二区| 美女网站在线免费欧美精品| 亚洲日本在线a| 国产欧美日韩亚州综合| 欧美卡1卡2卡| 一本在线高清不卡dvd| 国产剧情一区二区| 蜜桃av噜噜一区| 亚洲国产欧美一区二区三区丁香婷| 久久久噜噜噜久久中文字幕色伊伊| 高清不卡一二三区| 亚洲mv在线观看| 久久久久久久久久久久久久久99 | 99麻豆久久久国产精品免费| 国产精品456| 国产福利91精品一区二区三区| 国产精品一二二区| 国产综合色精品一区二区三区| 免费成人在线观看视频| 日韩精品免费视频人成| 丝袜a∨在线一区二区三区不卡| 午夜精品福利在线| 日本伊人色综合网| 麻豆视频一区二区| 精品一区二区免费| 国产精品白丝av| 成人午夜在线视频| 成人av免费在线观看| 91丨九色丨尤物| 在线观看亚洲专区| 在线观看91精品国产麻豆| 欧美精品xxxxbbbb| 欧美zozo另类异族|