gio-gioscheduler.html

来自「最新gtk中文资料集」· HTML 代码 · 共 425 行 · 第 1/2 页

HTML
425
字号
                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> notify,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> io_priority,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Schedules the I/O job to run. </p><p><em class="parameter"><code>notify</code></em> will be called on <em class="parameter"><code>user_data</code></em> after <em class="parameter"><code>job_func</code></em> has returned,regardless whether the job was cancelled or has run to completion.</p><p>If <em class="parameter"><code>cancellable</code></em> is not <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, it can be used to cancel the I/O jobby calling <a class="link" href="GCancellable.html#g-cancellable-cancel"><code class="function">g_cancellable_cancel()</code></a> or by calling <a class="link" href="gio-GIOScheduler.html#g-io-scheduler-cancel-all-jobs"><code class="function">g_io_scheduler_cancel_all_jobs()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>job_func</code></em>&#160;:</span></p></td><td> a <a class="link" href="gio-GIOScheduler.html#GIOSchedulerJobFunc"><span class="type">GIOSchedulerJobFunc</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td> data to pass to <em class="parameter"><code>job_func</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> for <em class="parameter"><code>user_data</code></em>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>io_priority</code></em>&#160;:</span></p></td><td> the I/O priority of the request.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3136916"></a><h3><a name="g-io-scheduler-cancel-all-jobs"></a>g_io_scheduler_cancel_all_jobs ()</h3><a class="indexterm" name="id3136928"></a><pre class="programlisting">void                g_io_scheduler_cancel_all_jobs      (void);</pre><p>Cancels all cancellable I/O jobs. </p><p>A job is cancellable if a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> was passed into<a class="link" href="gio-GIOScheduler.html#g-io-scheduler-push-job"><code class="function">g_io_scheduler_push_job()</code></a>.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3136972"></a><h3><a name="g-io-scheduler-job-send-to-mainloop"></a>g_io_scheduler_job_send_to_mainloop ()</h3><a class="indexterm" name="id3136983"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            g_io_scheduler_job_send_to_mainloop (<a class="link" href="gio-GIOScheduler.html#GIOSchedulerJob">GIOSchedulerJob</a> *job,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GSourceFunc">GSourceFunc</a> func,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> notify);</pre><p>Used from an I/O job to send a callback to be run in the main loop (main thread), waiting for the result (and thus blocking the I/O job).</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>job</code></em>&#160;:</span></p></td><td> a <a class="link" href="gio-GIOScheduler.html#GIOSchedulerJob"><span class="type">GIOSchedulerJob</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GSourceFunc"><span class="type">GSourceFunc</span></a> callback that will be called in the main thread</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td> data to pass to <em class="parameter"><code>func</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> for <em class="parameter"><code>user_data</code></em>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> The return value of <em class="parameter"><code>func</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3137159"></a><h3><a name="g-io-scheduler-job-send-to-mainloop-async"></a>g_io_scheduler_job_send_to_mainloop_async ()</h3><a class="indexterm" name="id3137174"></a><pre class="programlisting">void                g_io_scheduler_job_send_to_mainloop_async                                                        (<a class="link" href="gio-GIOScheduler.html#GIOSchedulerJob">GIOSchedulerJob</a> *job,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GSourceFunc">GSourceFunc</a> func,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> notify);</pre><p>Used from an I/O job to send a callback to be run asynchronously in the main loop (main thread). The callback will be run when the main loop is available, but at that time the I/O job might have finished. The return value from the callback is ignored.</p><p>Note that if you are passing the <em class="parameter"><code>user_data</code></em> from <a class="link" href="gio-GIOScheduler.html#g-io-scheduler-push-job"><code class="function">g_io_scheduler_push_job()</code></a>on to this function you have to ensure that it is not freed before<em class="parameter"><code>func</code></em> is called, either by passing <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> as <em class="parameter"><code>notify</code></em> to <a class="link" href="gio-GIOScheduler.html#g-io-scheduler-push-job"><code class="function">g_io_scheduler_push_job()</code></a> or by using refcounting for <em class="parameter"><code>user_data</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>job</code></em>&#160;:</span></p></td><td> a <a class="link" href="gio-GIOScheduler.html#GIOSchedulerJob"><span class="type">GIOSchedulerJob</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GSourceFunc"><span class="type">GSourceFunc</span></a> callback that will be called in the main thread</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td> data to pass to <em class="parameter"><code>func</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> for <em class="parameter"><code>user_data</code></em>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3137392"></a><div class="refsect2" lang="en"><a name="id3137394"></a></div><hr><div class="refsect2" lang="en"><a name="id3137395"></a></div></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?