Go to the documentation of this file.00001
00146 #ifndef LEGATO_THREAD_INCLUDE_GUARD
00147 #define LEGATO_THREAD_INCLUDE_GUARD
00148
00149
00155
00156 typedef struct le_thread* le_thread_Ref_t;
00157
00158
00159
00171
00172 typedef enum
00173 {
00174 LE_THREAD_PRIORITY_IDLE = 0,
00175 LE_THREAD_PRIORITY_NORMAL,
00176 LE_THREAD_PRIORITY_RT_1,
00177
00178 LE_THREAD_PRIORITY_RT_2,
00179 LE_THREAD_PRIORITY_RT_3,
00180 LE_THREAD_PRIORITY_RT_4,
00181 LE_THREAD_PRIORITY_RT_5,
00182 LE_THREAD_PRIORITY_RT_6,
00183 LE_THREAD_PRIORITY_RT_7,
00184 LE_THREAD_PRIORITY_RT_8,
00185 LE_THREAD_PRIORITY_RT_9,
00186 LE_THREAD_PRIORITY_RT_10,
00187 LE_THREAD_PRIORITY_RT_11,
00188 LE_THREAD_PRIORITY_RT_12,
00189 LE_THREAD_PRIORITY_RT_13,
00190 LE_THREAD_PRIORITY_RT_14,
00191 LE_THREAD_PRIORITY_RT_15,
00192 LE_THREAD_PRIORITY_RT_16,
00193 LE_THREAD_PRIORITY_RT_17,
00194 LE_THREAD_PRIORITY_RT_18,
00195 LE_THREAD_PRIORITY_RT_19,
00196 LE_THREAD_PRIORITY_RT_20,
00197 LE_THREAD_PRIORITY_RT_21,
00198 LE_THREAD_PRIORITY_RT_22,
00199 LE_THREAD_PRIORITY_RT_23,
00200 LE_THREAD_PRIORITY_RT_24,
00201 LE_THREAD_PRIORITY_RT_25,
00202 LE_THREAD_PRIORITY_RT_26,
00203 LE_THREAD_PRIORITY_RT_27,
00204 LE_THREAD_PRIORITY_RT_28,
00205 LE_THREAD_PRIORITY_RT_29,
00206 LE_THREAD_PRIORITY_RT_30,
00207 LE_THREAD_PRIORITY_RT_31,
00208 LE_THREAD_PRIORITY_RT_32
00209 }
00210 le_thread_Priority_t;
00211
00212 #define LE_THREAD_PRIORITY_RT_LOWEST LE_THREAD_PRIORITY_RT_1 ///< Lowest real-time priority.
00213 #define LE_THREAD_PRIORITY_RT_HIGHEST LE_THREAD_PRIORITY_RT_32 ///< Highest real-time priority.
00214
00215
00216
00225
00226 typedef void* (* le_thread_MainFunc_t)
00227 (
00228 void* context
00229 );
00230
00231
00232
00239
00240 le_thread_Ref_t le_thread_Create
00241 (
00242 const char* name,
00243 le_thread_MainFunc_t mainFunc,
00244 void* context
00245 );
00246
00247
00248
00258
00259 le_result_t le_thread_SetPriority
00260 (
00261 le_thread_Ref_t thread,
00262 le_thread_Priority_t priority
00263 );
00264
00265
00266
00283
00284 le_result_t le_thread_SetStackSize
00285 (
00286 le_thread_Ref_t thread,
00287 size_t size
00288
00289 );
00290
00291
00292
00298
00299 void le_thread_SetJoinable
00300 (
00301 le_thread_Ref_t thread
00302 );
00303
00304
00305
00310
00311 void le_thread_Start
00312 (
00313 le_thread_Ref_t thread
00314 );
00315
00316
00317
00338
00339 le_result_t le_thread_Join
00340 (
00341 le_thread_Ref_t thread,
00342 void** resultValuePtr
00343
00344
00345 );
00346
00347
00348
00352
00353 void le_thread_Exit
00354 (
00355 void* resultValue
00356
00357
00358 );
00359
00360
00361
00370
00371 le_result_t le_thread_Cancel
00372 (
00373 le_thread_Ref_t threadToCancel
00374 );
00375
00376
00377
00383
00384 le_thread_Ref_t le_thread_GetCurrent
00385 (
00386 void
00387 );
00388
00389
00390
00394
00395 void le_thread_GetName
00396 (
00397 le_thread_Ref_t threadRef,
00398 char* buffPtr,
00399 size_t buffSize
00400 );
00401
00402
00403
00407
00408 const char* le_thread_GetMyName
00409 (
00410 void
00411 );
00412
00413
00414
00421
00422 typedef void (* le_thread_Destructor_t)
00423 (
00424 void* context
00425
00426 );
00427
00428
00429
00438
00439 void le_thread_AddDestructor
00440 (
00441 le_thread_Destructor_t destructor,
00442 void* context
00443 );
00444
00445
00446
00469
00470 void le_thread_AddChildDestructor
00471 (
00472 le_thread_Ref_t thread,
00473 le_thread_Destructor_t destructor,
00474 void* context
00475 );
00476
00477
00478 #endif // LEGATO_THREAD_INCLUDE_GUARD