| 978 | } |
| 979 | |
| 980 | task* generic_scheduler::get_mailbox_task() { |
| 981 | __TBB_ASSERT( my_affinity_id>0, "not in arena" ); |
| 982 | while ( task_proxy* const tp = my_inbox.pop() ) { |
| 983 | if ( task* result = tp->extract_task<task_proxy::mailbox_bit>() ) { |
| 984 | ITT_NOTIFY( sync_acquired, my_inbox.outbox() ); |
| 985 | result->prefix().extra_state |= es_task_is_stolen; |
| 986 | return result; |
| 987 | } |
| 988 | // We have exclusive access to the proxy, and can destroy it. |
| 989 | free_task<no_cache_small_task>(*tp); |
| 990 | } |
| 991 | return NULL; |
| 992 | } |
| 993 | |
| 994 | // TODO: Rename to publish_task_pool |
| 995 | void generic_scheduler::enter_arena() { |