/usr/share/doc/libglobus-common-dev/html/group__globus__thread.html is in libglobus-common-doc 14.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<!-- THIS FILE IS AUTOMATICALLY GENERATED FROM THE GLOBUS SOURCE CODE
DO NOT MODIFY.
-->
<title>Globus Reference Manual</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('group__globus__thread.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#groups">Modules</a> |
<a href="#define-members">Defines</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Threading</div> </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Collaboration diagram for Threading:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__globus__thread.png" border="0" alt="" usemap="#group____globus____thread"/>
<map name="group____globus____thread" id="group____globus____thread">
<area shape="rect" id="node2" href="group__globus__mutex.html" title="Mutual Exclusion" alt="" coords="153,5,276,35"/><area shape="rect" id="node3" href="group__globus__thread__key.html" title="Thread-Specific Storage" alt="" coords="133,59,296,88"/><area shape="rect" id="node4" href="group__globus__cond.html" title="Condition Variables" alt="" coords="148,112,281,141"/><area shape="rect" id="node5" href="group__globus__thread__once.html" title="One-time execution" alt="" coords="148,165,281,195"/></map>
</td></tr></table></center>
</div>
<h2><a name="nested-classes"></a>
Data Structures</h2>
<ul>
<li>union <a class="el" href="unionglobus__thread__t.html">globus_thread_t</a>
<dl class="el"><dd class="mdescRight">Thread ID. <a href="unionglobus__thread__t.html#details">More...</a><br/></dl><li>union <a class="el" href="unionglobus__threadattr__t.html">globus_threadattr_t</a>
<dl class="el"><dd class="mdescRight">Thread attributes. <a href="unionglobus__threadattr__t.html#details">More...</a><br/></dl><li>union <a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a>
<dl class="el"><dd class="mdescRight">Thread-specific data key. <a href="unionglobus__thread__key__t.html#details">More...</a><br/></dl></ul>
<h2><a name="groups"></a>
Modules</h2>
<ul>
<li><a class="el" href="group__globus__mutex.html">Mutual Exclusion</a>
<li><a class="el" href="group__globus__cond.html">Condition Variables</a>
<li><a class="el" href="group__globus__thread__key.html">Thread-Specific Storage</a>
<li><a class="el" href="group__globus__thread__once.html">One-time execution</a>
</ul>
<h2><a name="define-members"></a>
Defines</h2>
<ul>
<li>#define <a class="el" href="group__globus__thread.html#gaf15a5fb8ed82c9a48bf3315bfe1142c9">GLOBUS_THREAD_CANCEL_DISABLE</a>   0
<li>#define <a class="el" href="group__globus__thread.html#ga54aa25c95e89566ba181eea9733651d0">GLOBUS_THREAD_CANCEL_ENABLE</a>   1
<li>#define <a class="el" href="group__globus__thread.html#ga1e4ac32bb0133044557d82ae454c5524">GLOBUS_THREAD_MODULE</a>   (&globus_i_thread_module)
</ul>
<h2><a name="typedef-members"></a>
Typedefs</h2>
<ul>
<li>typedef void(* <a class="el" href="group__globus__thread.html#gab9a4db7600579bd5aad4383fa57551d9">globus_thread_key_destructor_func_t</a> )(void *value)
</ul>
<h2><a name="func-members"></a>
Functions</h2>
<ul>
<li>int <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b">globus_thread_set_model</a> (const char *model)
<li>int <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775">globus_thread_create</a> (<a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> *thread, <a class="el" href="unionglobus__threadattr__t.html">globus_threadattr_t</a> *attr, globus_thread_func_t func, void *user_arg)
<li>void <a class="el" href="group__globus__thread.html#ga6a6e15c71b17287216b6503861386d37">globus_thread_yield</a> (void)
<li>void <a class="el" href="group__globus__thread.html#gad82ec7a9a046558859124766c85e8491">globus_thread_exit</a> (void *value)
<li>int <a class="el" href="group__globus__thread.html#gadf6ddab884b07297c0699e9793aa8726">globus_thread_sigmask</a> (int how, const sigset_t *new_mask, sigset_t *old_mask)
<li>int <a class="el" href="group__globus__thread.html#gae606e850d19fd3fe438fa6bfc6515394">globus_thread_kill</a> (<a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> thread, int sig)
<li><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> <a class="el" href="group__globus__thread.html#ga0075f9c3c3c1e2a2eb41a10913ccfca6">globus_thread_self</a> (void)
<li>globus_bool_t <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32">globus_thread_equal</a> (<a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> thread1, <a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> thread2)
<li>globus_bool_t <a class="el" href="group__globus__thread.html#ga138729b018e3e31bd591d9421af656f7">globus_thread_preemptive_threads</a> (void)
<li>globus_bool_t <a class="el" href="group__globus__thread.html#ga8df3fff10bd599db534519b6907e1922">globus_i_am_only_thread</a> (void)
<li>void * <a class="el" href="group__globus__thread.html#ga990a7deb9ec83c5bf4ca8a25d1fdc3a0">globus_thread_cancellable_func</a> (void *(*func)(void *), void *arg, void(*cleanup_func)(void *), void *cleanup_arg, globus_bool_t execute_cleanup)
<li>int <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f">globus_thread_cancel</a> (<a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> thr)
<li>void <a class="el" href="group__globus__thread.html#gae0397b4b91b07b45d27f30ba5954bc7c">globus_thread_testcancel</a> (void)
<li>int <a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c">globus_thread_setcancelstate</a> (int state, int *oldstate)
</ul>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>The Globus runtime includes support for portably creating threads on POSIX and Windows systems. </p>
<p>It also provides a callback-driven system for applications that may use threads but don't require them. The Globus Thread API is modeled closely after the POSIX threads API.</p>
<p>Applications can choose whether to run as threaded or non-threaded at runtime by either setting the GLOBUS_THREAD_MODEL environment variable or calling the <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b" title="Select threading model for an application.">globus_thread_set_model()</a> function prior to activating any Globus modules.</p>
<p>The Globus thread system provides primitives for mutual exclusion (<a class="el" href="unionglobus__mutex__t.html" title="Mutex.">globus_mutex_t</a>, <a class="el" href="structglobus__rmutex__t.html" title="Recursive Mutex.">globus_rmutex_t</a>, globus_rw_mutex_t), event synchronization (<a class="el" href="unionglobus__cond__t.html" title="Condition variable.">globus_cond_t</a>), one-time execution (globus_once_t), and threading (<a class="el" href="unionglobus__thread__t.html" title="Thread ID.">globus_thread_t</a>).</p>
<p>In non-threaded operation, <a class="el" href="group__globus__cond.html#ga9b58106e5b1b2545ab45db0e3e4f98b0" title="Wait for a condition to be signalled.">globus_cond_wait()</a> and its variants will poll the callback queue and I/O system to allow event-driven programs to run in the absence of threads. The <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775" title="Create a new thread.">globus_thread_create()</a> function will fail in that model. Other primitive operations will return success but not provide any thread exclusion as there is only one thread. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gaf15a5fb8ed82c9a48bf3315bfe1142c9"></a><!-- doxytag: member="globus_thread.h::GLOBUS_THREAD_CANCEL_DISABLE" ref="gaf15a5fb8ed82c9a48bf3315bfe1142c9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__globus__thread.html#gaf15a5fb8ed82c9a48bf3315bfe1142c9">GLOBUS_THREAD_CANCEL_DISABLE</a>   0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disable thread cancellation value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c" title="Set the thread's cancellable state.">globus_thread_setcancelstate()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga54aa25c95e89566ba181eea9733651d0"></a><!-- doxytag: member="globus_thread.h::GLOBUS_THREAD_CANCEL_ENABLE" ref="ga54aa25c95e89566ba181eea9733651d0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__globus__thread.html#ga54aa25c95e89566ba181eea9733651d0">GLOBUS_THREAD_CANCEL_ENABLE</a>   1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enable thread cancellation value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c" title="Set the thread's cancellable state.">globus_thread_setcancelstate()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga1e4ac32bb0133044557d82ae454c5524"></a><!-- doxytag: member="globus_thread.h::GLOBUS_THREAD_MODULE" ref="ga1e4ac32bb0133044557d82ae454c5524" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__globus__thread.html#ga1e4ac32bb0133044557d82ae454c5524">GLOBUS_THREAD_MODULE</a>   (&globus_i_thread_module)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Thread Module. </p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gab9a4db7600579bd5aad4383fa57551d9"></a><!-- doxytag: member="globus_thread.h::globus_thread_key_destructor_func_t" ref="gab9a4db7600579bd5aad4383fa57551d9" args=")(void *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__globus__thread.html#gab9a4db7600579bd5aad4383fa57551d9">globus_thread_key_destructor_func_t</a>)(void *value)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Thread-specific data destructor. </p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gab1e6b22b1d55346b3191402fdc7e341b"></a><!-- doxytag: member="globus_thread.c::globus_thread_set_model" ref="gab1e6b22b1d55346b3191402fdc7e341b" args="(const char *model)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b">globus_thread_set_model</a> </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>model</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Select threading model for an application. </p>
<p>The <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b" title="Select threading model for an application.">globus_thread_set_model()</a> function selects which runtime model the current application will use. By default, the Globus runtime uses a non-threaded model. Additional models may be available based on system support: pthread, or windows. This function must be called prior to activating any globus module, as it changes how certain functions (like <a class="el" href="group__globus__mutex.html#ga053b5f9b263f11b7305efdbee881bf5d" title="Lock a mutex.">globus_mutex_lock()</a> and <a class="el" href="group__globus__cond.html#ga9b58106e5b1b2545ab45db0e3e4f98b0" title="Wait for a condition to be signalled.">globus_cond_wait()</a>) behave. This function overrides the value set by the GLOBUS_THREAD_MODEL environment variable.</p>
<p>The <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b" title="Select threading model for an application.">globus_thread_set_model()</a> function will fail if a Globus module has been activated already.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">model</td><td>The name of the thread model to use. Depending on operating system capabilities, this may be "none", "pthread", "windows", or some other custom thread implementation. The corresponding libtool module "libglobus_thread_pthread.la" or "libglobus_thread_windows.la" must be installed on the system for it to be used.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b" title="Select threading model for an application.">globus_thread_set_model()</a> sets the name of the thread model to use and returns GLOBUS_SUCCESS. If an error occurs, then <a class="el" href="group__globus__thread.html#gab1e6b22b1d55346b3191402fdc7e341b" title="Select threading model for an application.">globus_thread_set_model()</a> returns GLOBUS_FAILURE. </dd></dl>
</div>
</div>
<a class="anchor" id="gac743f4cd1e4a49e6ccc23dea8d8a1775"></a><!-- doxytag: member="globus_thread.c::globus_thread_create" ref="gac743f4cd1e4a49e6ccc23dea8d8a1775" args="(globus_thread_t *thread, globus_threadattr_t *attr, globus_thread_func_t func, void *user_arg)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775">globus_thread_create</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> * </td>
<td class="paramname"><em>thread</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="unionglobus__threadattr__t.html">globus_threadattr_t</a> * </td>
<td class="paramname"><em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">globus_thread_func_t </td>
<td class="paramname"><em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>user_arg</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a new thread. </p>
<p>The <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775" title="Create a new thread.">globus_thread_create()</a> function creates a new thread of execution in the current process to run the function pointed to by the <em>func</em> parameter passed the <em>user_arg</em> value as its only parameter. This new thread will be detached, so that storage associated with the thread will be automatically reclaimed by the operating system. A thread identifier will be copied to the value pointed by the <em>thread</em> parameter if it is non-NULL. The caller may use this thread identifier to signal or cancel this thread. The <em>attr</em> paramter is ignored by this function. If the "none" threading model is used by an application, then this function will always fail. One alternative that will work both with and without threads is to use the functions in the <a class="el" href="group__globus__callback.html">Globus Callback API </a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">thread</td><td>Pointer to a variable to contain the new thread's identifier. </td></tr>
<tr><td class="paramname">attr</td><td>Ignored </td></tr>
<tr><td class="paramname">func</td><td>Pointer to a function to start in the new thread. </td></tr>
<tr><td class="paramname">user_arg</td><td>Argument to the new thread's function.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775" title="Create a new thread.">globus_thread_create()</a> will start a new thread, invoking (*func)(user_arg), modify the value pointed to by the <em>thread</em> parameter to contain the new thread's identifier and return GLOBUS_SUCCESS. If an error occurs, then the value of <em>thread</em> is undefined and <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775" title="Create a new thread.">globus_thread_create()</a> returns an implementation-specific non-zero error value. </dd></dl>
</div>
</div>
<a class="anchor" id="ga6a6e15c71b17287216b6503861386d37"></a><!-- doxytag: member="globus_thread.c::globus_thread_yield" ref="ga6a6e15c71b17287216b6503861386d37" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__globus__thread.html#ga6a6e15c71b17287216b6503861386d37">globus_thread_yield</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Yield execution to another thread. </p>
<p>The <a class="el" href="group__globus__thread.html#ga6a6e15c71b17287216b6503861386d37" title="Yield execution to another thread.">globus_thread_yield()</a> function yields execution to other threads which are ready for execution. The current thread may continue to execute if there are no other threads in the system's ready queue. </p>
</div>
</div>
<a class="anchor" id="gad82ec7a9a046558859124766c85e8491"></a><!-- doxytag: member="globus_thread.c::globus_thread_exit" ref="gad82ec7a9a046558859124766c85e8491" args="(void *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__globus__thread.html#gad82ec7a9a046558859124766c85e8491">globus_thread_exit</a> </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Terminate the current threadThe <a class="el" href="group__globus__thread.html#gad82ec7a9a046558859124766c85e8491" title="Terminate the current threadThe globus_thread_exit() terminates the current thread with the value pas...">globus_thread_exit()</a> terminates the current thread with the value passed to it. </p>
<p>This function does not return. </p>
</div>
</div>
<a class="anchor" id="gadf6ddab884b07297c0699e9793aa8726"></a><!-- doxytag: member="globus_thread.c::globus_thread_sigmask" ref="gadf6ddab884b07297c0699e9793aa8726" args="(int how, const sigset_t *new_mask, sigset_t *old_mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#gadf6ddab884b07297c0699e9793aa8726">globus_thread_sigmask</a> </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>how</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const sigset_t * </td>
<td class="paramname"><em>new_mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">sigset_t * </td>
<td class="paramname"><em>old_mask</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Modify the current thread's signal mask. </p>
<p>The <a class="el" href="group__globus__thread.html#gadf6ddab884b07297c0699e9793aa8726" title="Modify the current thread's signal mask.">globus_thread_sigmask()</a> function modifies the current thread's signal mask and returns the old value of the signal mask in the value pointed to by the <em>old_mask</em> parameter. The <em>how</em> parameter can be one of SIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK to control how the signal mask is modified.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">how</td><td>Flag indicating how to interpret <em>new_mask</em> if it is non-NULL. If <em>how</em> is SIG_BLOCK, then all signals in <em>new_mask</em> are blocked, as well as any which were previously blocked. If <em>how</em> is SIG_UNBLOCK, then all signals in which were previously blocked in <em>new_mask</em> are unblocked. If <em>how</em> is SIG_SETMASK, then the old signal mask is replaced with the value of <em>new_mask</em>. </td></tr>
<tr><td class="paramname">new_mask</td><td>Set of signals to block or unblock, based on the <em>how</em> parameter. </td></tr>
<tr><td class="paramname">old_mask</td><td>A pointer to be set to the old signal mask associated with the current thread.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread.html#gadf6ddab884b07297c0699e9793aa8726" title="Modify the current thread's signal mask.">globus_thread_sigmask()</a> modifies the signal mask, modifies the value pointed to by <em>old_mask</em> with the signal mask prior to this function's execution and returns GLOBUS_SUCCESS. If an error occurs, <a class="el" href="group__globus__thread.html#gadf6ddab884b07297c0699e9793aa8726" title="Modify the current thread's signal mask.">globus_thread_sigmask()</a> returns an implementation-specific non-zero error value. </dd></dl>
</div>
</div>
<a class="anchor" id="gae606e850d19fd3fe438fa6bfc6515394"></a><!-- doxytag: member="globus_thread.c::globus_thread_kill" ref="gae606e850d19fd3fe438fa6bfc6515394" args="(globus_thread_t thread, int sig)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#gae606e850d19fd3fe438fa6bfc6515394">globus_thread_kill</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> </td>
<td class="paramname"><em>thread</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>sig</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Send a signal to a thread. </p>
<p>The <a class="el" href="group__globus__thread.html#gae606e850d19fd3fe438fa6bfc6515394" title="Send a signal to a thread.">globus_thread_kill()</a> function sends the signal specified by the <em>sig</em> number to the thread whose ID matches the <em>thread</em> parameter. Depending on the signal mask of that thread, this may result in a signal being delivered or not, and depending on the process's signal actions, a signal handler, termination, or no operation will occur in that thread.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">thread</td><td>The thread identifier of the thread to signal. </td></tr>
<tr><td class="paramname">sig</td><td>The signal to send to the thread. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread.html#gae606e850d19fd3fe438fa6bfc6515394" title="Send a signal to a thread.">globus_thread_kill()</a> queues the signal for delivery to the specified thread and returns GLOBUS_SUCCESS. If an error occurs, <a class="el" href="group__globus__thread.html#gae606e850d19fd3fe438fa6bfc6515394" title="Send a signal to a thread.">globus_thread_kill()</a> returns an implementation-specific non-zero error value. </dd></dl>
</div>
</div>
<a class="anchor" id="ga0075f9c3c3c1e2a2eb41a10913ccfca6"></a><!-- doxytag: member="globus_thread.c::globus_thread_self" ref="ga0075f9c3c3c1e2a2eb41a10913ccfca6" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> <a class="el" href="group__globus__thread.html#ga0075f9c3c3c1e2a2eb41a10913ccfca6">globus_thread_self</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determine the current thread's ID. </p>
<p>The <a class="el" href="group__globus__thread.html#ga0075f9c3c3c1e2a2eb41a10913ccfca6" title="Determine the current thread's ID.">globus_thread_self()</a> function returns the thread identifier of the current thread. This value is unique among all threads which are running at any given time. </p>
</div>
</div>
<a class="anchor" id="ga0858d6945cc5ed82cec65eadd2ef0a32"></a><!-- doxytag: member="globus_thread.c::globus_thread_equal" ref="ga0858d6945cc5ed82cec65eadd2ef0a32" args="(globus_thread_t thread1, globus_thread_t thread2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">globus_bool_t <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32">globus_thread_equal</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> </td>
<td class="paramname"><em>thread1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> </td>
<td class="paramname"><em>thread2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Check whether thread identifiers match. </p>
<p>The <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32" title="Check whether thread identifiers match.">globus_thread_equal()</a> function checks whether the thread identifiers passed as the <em>thread1</em> and <em>thread2</em> parameters refer to the same thread. If so, <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32" title="Check whether thread identifiers match.">globus_thread_equal()</a> returns GLOBUS_TRUE; otherwise GLOBUS_FALSE.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">thread1</td><td>Thread identifier to compare. </td></tr>
<tr><td class="paramname">thread2</td><td>Thread identifier to compare. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga138729b018e3e31bd591d9421af656f7"></a><!-- doxytag: member="globus_thread.c::globus_thread_preemptive_threads" ref="ga138729b018e3e31bd591d9421af656f7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">globus_bool_t <a class="el" href="group__globus__thread.html#ga138729b018e3e31bd591d9421af656f7">globus_thread_preemptive_threads</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Indicate whether the active thread model supports preemption. </p>
<p>The <a class="el" href="group__globus__thread.html#ga138729b018e3e31bd591d9421af656f7" title="Indicate whether the active thread model supports preemption.">globus_thread_preemptive_threads()</a> function returns GLOBUS_TRUE if the current thread model supports thread preemption; othwerise it returns GLOBUS_FALSE. </p>
</div>
</div>
<a class="anchor" id="ga8df3fff10bd599db534519b6907e1922"></a><!-- doxytag: member="globus_thread.c::globus_i_am_only_thread" ref="ga8df3fff10bd599db534519b6907e1922" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">globus_bool_t <a class="el" href="group__globus__thread.html#ga8df3fff10bd599db534519b6907e1922">globus_i_am_only_thread</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determine if threads are supported. </p>
<p>The <a class="el" href="group__globus__thread.html#ga8df3fff10bd599db534519b6907e1922" title="Determine if threads are supported.">globus_i_am_only_thread()</a> function returns GLOBUS_TRUE if the current thread model is the "none" thread model; GLOBUS_FALSE otherwise. If running with the "none" thread model, there will only be one Globus thread available and the <a class="el" href="group__globus__thread.html#gac743f4cd1e4a49e6ccc23dea8d8a1775" title="Create a new thread.">globus_thread_create()</a> function will always fail. </p>
</div>
</div>
<a class="anchor" id="ga990a7deb9ec83c5bf4ca8a25d1fdc3a0"></a><!-- doxytag: member="globus_thread.c::globus_thread_cancellable_func" ref="ga990a7deb9ec83c5bf4ca8a25d1fdc3a0" args="(void *(*func)(void *), void *arg, void(*cleanup_func)(void *), void *cleanup_arg, globus_bool_t execute_cleanup)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* <a class="el" href="group__globus__thread.html#ga990a7deb9ec83c5bf4ca8a25d1fdc3a0">globus_thread_cancellable_func</a> </td>
<td>(</td>
<td class="paramtype">void *(*)(void *) </td>
<td class="paramname"><em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>arg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)(void *) </td>
<td class="paramname"><em>cleanup_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>cleanup_arg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">globus_bool_t </td>
<td class="paramname"><em>execute_cleanup</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Execute a function with thread cleanup in case of cancellation. </p>
<p>The <a class="el" href="group__globus__thread.html#ga990a7deb9ec83c5bf4ca8a25d1fdc3a0" title="Execute a function with thread cleanup in case of cancellation.">globus_thread_cancellable_func()</a> function provides an interface to POSIX thread cancellation points that does not rely on preprocessor macros. It is roughly equivalent to </p>
<div class="fragment"><pre class="fragment"> pthread_cleanup_push(cleanup_func, cleanup_arg);
(*func)(arg);
pthread_cleanup_pop(execute_cleanup)
</pre></div><dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">func</td><td>Pointer to a function which may be cancelled. </td></tr>
<tr><td class="paramname">arg</td><td>Parameter to the <em>func</em> function. </td></tr>
<tr><td class="paramname">cleanup_func</td><td>Pointer to a function to execute if thread cancellation occurs during <em>func</em>. </td></tr>
<tr><td class="paramname">cleanup_arg</td><td>Parameter to the <em>cleanup_func</em> function. </td></tr>
<tr><td class="paramname">execute_cleanup</td><td>Flag indicating whether the function pointed to by <em>cleanup_func</em> should be executed after <em>func</em> completes even if it is not cancelled.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="group__globus__thread.html#ga990a7deb9ec83c5bf4ca8a25d1fdc3a0" title="Execute a function with thread cleanup in case of cancellation.">globus_thread_cancellable_func()</a> returns the value returned by <em>func</em>. </dd></dl>
</div>
</div>
<a class="anchor" id="ga3aca327a5a9ed473446a788f255e793f"></a><!-- doxytag: member="globus_thread.c::globus_thread_cancel" ref="ga3aca327a5a9ed473446a788f255e793f" args="(globus_thread_t thr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f">globus_thread_cancel</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="unionglobus__thread__t.html">globus_thread_t</a> </td>
<td class="paramname"><em>thr</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Cancel a thread. </p>
<p>The <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f" title="Cancel a thread.">globus_thread_cancel()</a> function cancels the thread with the identifier <em>thr</em> if it is still executing. If it is running with a cancellation cleanup stack, the functions in that stack are executed. The target thread's cancel state determines when the cancellation is delivered.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">thr</td><td>The id of the thread to cancel</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, the <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f" title="Cancel a thread.">globus_thread_cancel()</a> function delivers the cancellation to the target thread and returns GLOBUS_SUCCESS. If an error occurs, <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f" title="Cancel a thread.">globus_thread_cancel()</a> returns an implementation-specific non-zero error value. </dd></dl>
</div>
</div>
<a class="anchor" id="gae0397b4b91b07b45d27f30ba5954bc7c"></a><!-- doxytag: member="globus_thread.c::globus_thread_testcancel" ref="gae0397b4b91b07b45d27f30ba5954bc7c" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__globus__thread.html#gae0397b4b91b07b45d27f30ba5954bc7c">globus_thread_testcancel</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Thread cancellation point. </p>
<p>The <a class="el" href="group__globus__thread.html#gae0397b4b91b07b45d27f30ba5954bc7c" title="Thread cancellation point.">globus_thread_testcancel()</a> function acts as a cancellation point for the current thread. If a thread has called <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f" title="Cancel a thread.">globus_thread_cancel()</a> and cancellation is enabled, this will cause the thread to be cancelled and any functions on the thread's cleanup stack to be executed. This function will not return if the thread is cancelled. </p>
</div>
</div>
<a class="anchor" id="ga201f97630ba96e417c65a9ffe4075e6c"></a><!-- doxytag: member="globus_thread.c::globus_thread_setcancelstate" ref="ga201f97630ba96e417c65a9ffe4075e6c" args="(int state, int *oldstate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c">globus_thread_setcancelstate</a> </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>oldstate</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the thread's cancellable state. </p>
<p>The <a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c" title="Set the thread's cancellable state.">globus_thread_setcancelstate()</a> function sets the current cancellation state to either GLOBUS_THREAD_CANCEL_DISABLE or GLOBUS_THREAD_CANCEL_ENABLE, do control whether <a class="el" href="group__globus__thread.html#ga3aca327a5a9ed473446a788f255e793f" title="Cancel a thread.">globus_thread_cancel()</a> is able to cancel this thread.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">state</td><td>The desired cancellation state. If the value is GLOBUS_THREAD_CANCEL_DISABLE, then cancellation will be disabled for this thread. If the value is GLOBUS_THREAD_CANCEL_ENABLE, then cancellation will be enabled for this thread. </td></tr>
<tr><td class="paramname">oldstate</td><td>A pointer to a value which will be set to the value of the thread's cancellation state when this function call began. This may be NULL if the caller is not interested in the previous value. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, the <a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c" title="Set the thread's cancellable state.">globus_thread_setcancelstate()</a> function modifies the thread cancellation state, modifies oldstate (if non-NULL) to the value of its previous state, and returns GLOBUS_SUCCESS. If an error occurs, <a class="el" href="group__globus__thread.html#ga201f97630ba96e417c65a9ffe4075e6c" title="Set the thread's cancellable state.">globus_thread_setcancelstate()</a> returns an implementation-specific non-zero error value. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div>
<div id="nav-path" class="navpath">
<ul>
<hr>
<p align="center">
<a href="http://www.globus.org/toolkit/about.html" target="_top">about globus</a> |
<a href="http://www.globus.org/toolkit/" target="_top">globus toolkit</a> |
<a href="https://dev.globus.org/wiki/Welcome/" target="_top">dev.globus</a>
<br>
<br>
Comments? <a href="mailto:webmaster@globus.org">webmaster@globus.org</a>
</body>
</html>
|