Rev 1610 | Rev 1653 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1610 | Rev 1614 | ||
|---|---|---|---|
| Line 50... | Line 50... | ||
| 50 | 50 | ||
| 51 | static atomic_t psthread_futex = FUTEX_INITIALIZER; |
51 | static atomic_t psthread_futex = FUTEX_INITIALIZER; |
| 52 | /** Count of real threads that are in async_serialized mode */ |
52 | /** Count of real threads that are in async_serialized mode */ |
| 53 | static int serialized_threads; /* Protected by async_futex */ |
53 | static int serialized_threads; /* Protected by async_futex */ |
| 54 | /** Thread-local count of serialization. If >0, we must not preempt */ |
54 | /** Thread-local count of serialization. If >0, we must not preempt */ |
| 55 | static __thread serialization_count; |
55 | static __thread int serialization_count; |
| 56 | /** Counter of threads residing in async_manager */ |
56 | /** Counter of threads residing in async_manager */ |
| 57 | static int threads_in_manager; |
57 | static int threads_in_manager; |
| 58 | 58 | ||
| 59 | /** Setup PSthread information into TCB structure */ |
59 | /** Setup PSthread information into TCB structure */ |
| 60 | psthread_data_t * psthread_setup() |
60 | psthread_data_t * psthread_setup() |
| Line 87... | Line 87... | ||
| 87 | /** Function that is called on entry to new uspace thread */ |
87 | /** Function that is called on entry to new uspace thread */ |
| 88 | void psthread_main(void) |
88 | void psthread_main(void) |
| 89 | { |
89 | { |
| 90 | psthread_data_t *pt = __tcb_get()->pst_data; |
90 | psthread_data_t *pt = __tcb_get()->pst_data; |
| 91 | 91 | ||
| 92 | serialization_count = 0; // TODO: WHY HERE? |
- | |
| 93 | pt->retval = pt->func(pt->arg); |
92 | pt->retval = pt->func(pt->arg); |
| 94 | 93 | ||
| 95 | pt->finished = 1; |
94 | pt->finished = 1; |
| 96 | if (pt->waiter) |
95 | if (pt->waiter) |
| 97 | list_append(&pt->waiter->link, &ready_list); |
96 | list_append(&pt->waiter->link, &ready_list); |