| 320 | void* set_before_anybth(void* args); |
| 321 | |
| 322 | void set_before_anybth_impl(SBAData* data) { |
| 323 | ASSERT_EQ(NULL, bthread_getspecific(data->key)); |
| 324 | SBATLS *tls = new SBATLS; |
| 325 | tls->ndestroy = &data->ndestroy; |
| 326 | ASSERT_EQ(0, bthread_setspecific(data->key, tls)); |
| 327 | ASSERT_EQ(tls, bthread_getspecific(data->key)); |
| 328 | if (data->level++ == 0) { |
| 329 | bthread_t bth; |
| 330 | ASSERT_EQ(0, bthread_start_urgent(&bth, NULL, set_before_anybth, data)); |
| 331 | ASSERT_EQ(0, bthread_join(bth, NULL)); |
| 332 | ASSERT_EQ(1, data->ndestroy); |
| 333 | } else { |
| 334 | bthread_usleep(1000); |
| 335 | } |
| 336 | ASSERT_EQ(tls, bthread_getspecific(data->key)); |
| 337 | } |
| 338 | |
| 339 | void* set_before_anybth(void* args) { |
| 340 | set_before_anybth_impl((SBAData*)args); |
no test coverage detected