| 328 | extern "C" { |
| 329 | |
| 330 | int bthread_start_urgent(bthread_t* __restrict tid, |
| 331 | const bthread_attr_t* __restrict attr, |
| 332 | void * (*fn)(void*), |
| 333 | void* __restrict arg) { |
| 334 | bthread::TaskGroup* g = bthread::tls_task_group; |
| 335 | if (g) { |
| 336 | // if attribute is null use thread local task group |
| 337 | if (bthread::can_run_thread_local(attr)) { |
| 338 | return bthread::TaskGroup::start_foreground(&g, tid, attr, fn, arg); |
| 339 | } |
| 340 | } |
| 341 | return bthread::start_from_non_worker(tid, attr, fn, arg); |
| 342 | } |
| 343 | |
| 344 | int bthread_start_background(bthread_t* __restrict tid, |
| 345 | const bthread_attr_t* __restrict attr, |