Changeset 7030dab for libcfa/src/concurrency/kernel_private.hfa
- Timestamp:
- Apr 6, 2020, 4:46:28 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- e3bc51c
- Parents:
- 71d6bd8 (diff), 057298e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
libcfa/src/concurrency/kernel_private.hfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel_private.hfa
r71d6bd8 r7030dab 10 10 // Created On : Mon Feb 13 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 29 14:06:40 201813 // Update Count : 312 // Last Modified On : Sat Nov 30 19:25:02 2019 13 // Update Count : 8 14 14 // 15 15 … … 31 31 } 32 32 33 void ScheduleThread( thread_desc * ); 34 static inline void WakeThread( thread_desc * thrd ) { 35 if( !thrd ) return; 36 37 verify(thrd->state == Inactive); 38 39 disable_interrupts(); 40 ScheduleThread( thrd ); 41 enable_interrupts( __cfaabi_dbg_ctx ); 42 } 43 thread_desc * nextThread(cluster * this); 33 void __schedule_thread( $thread * ) __attribute__((nonnull (1))); 44 34 45 35 //Block current thread and release/wake-up the following resources 46 void BlockInternal(void); 47 void BlockInternal(__spinlock_t * lock); 48 void BlockInternal(thread_desc * thrd); 49 void BlockInternal(__spinlock_t * lock, thread_desc * thrd); 50 void BlockInternal(__spinlock_t * locks [], unsigned short count); 51 void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count); 52 void BlockInternal(__finish_callback_fptr_t callback); 53 void LeaveThread(__spinlock_t * lock, thread_desc * thrd); 36 void __leave_thread() __attribute__((noreturn)); 54 37 55 38 //----------------------------------------------------------------------------- … … 57 40 void main(processorCtx_t *); 58 41 59 static inline void wake_fast(processor * this) { 60 __cfaabi_dbg_print_safe("Kernel : Waking up processor %p\n", this); 61 post( this->idleLock ); 62 } 42 void * __create_pthread( pthread_t *, void * (*)(void *), void * ); 63 43 64 static inline void wake(processor * this) { 65 disable_interrupts(); 66 wake_fast(this); 67 enable_interrupts( __cfaabi_dbg_ctx ); 68 } 44 69 45 70 46 struct event_kernel_t { … … 86 62 // Threads 87 63 extern "C" { 88 forall(dtype T | is_thread(T)) 89 void CtxInvokeThread(T * this); 64 void __cfactx_invoke_thread(void (*main)(void *), void * this); 90 65 } 91 66 92 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);93 94 67 __cfaabi_dbg_debug_do( 95 extern void __cfaabi_dbg_thread_register ( thread_desc* thrd );96 extern void __cfaabi_dbg_thread_unregister( thread_desc* thrd );68 extern void __cfaabi_dbg_thread_register ( $thread * thrd ); 69 extern void __cfaabi_dbg_thread_unregister( $thread * thrd ); 97 70 ) 98 71 … … 101 74 #define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)] 102 75 103 static inline uint32_t tls_rand() {76 static inline uint32_t __tls_rand() { 104 77 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6; 105 78 kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21; … … 112 85 void unregister( struct cluster & cltr ); 113 86 114 void doregister( struct cluster * cltr, struct thread_desc& thrd );115 void unregister( struct cluster * cltr, struct thread_desc& thrd );87 void doregister( struct cluster * cltr, struct $thread & thrd ); 88 void unregister( struct cluster * cltr, struct $thread & thrd ); 116 89 117 90 void doregister( struct cluster * cltr, struct processor * proc );
Note:
See TracChangeset
for help on using the changeset viewer.