- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel_private.hfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel_private.hfa
rac2b598 r2026bb6 10 10 // Created On : Mon Feb 13 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Nov 30 19:25:02 201913 // Update Count : 812 // Last Modified On : Thu Mar 29 14:06:40 2018 13 // Update Count : 3 14 14 // 15 15 … … 31 31 } 32 32 33 void __schedule_thread( $thread * ) __attribute__((nonnull (1))); 33 void ScheduleThread( thread_desc * ); 34 static inline void WakeThread( thread_desc * thrd ) { 35 if( !thrd ) return; 36 37 disable_interrupts(); 38 ScheduleThread( thrd ); 39 enable_interrupts( __cfaabi_dbg_ctx ); 40 } 41 thread_desc * nextThread(cluster * this); 34 42 35 43 //Block current thread and release/wake-up the following resources 36 void __leave_thread() __attribute__((noreturn)); 44 void BlockInternal(void); 45 void BlockInternal(__spinlock_t * lock); 46 void BlockInternal(thread_desc * thrd); 47 void BlockInternal(__spinlock_t * lock, thread_desc * thrd); 48 void BlockInternal(__spinlock_t * locks [], unsigned short count); 49 void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count); 50 void BlockInternal(__finish_callback_fptr_t callback); 51 void LeaveThread(__spinlock_t * lock, thread_desc * thrd); 37 52 38 53 //----------------------------------------------------------------------------- 39 54 // Processor 40 55 void main(processorCtx_t *); 41 42 void * __create_pthread( pthread_t *, void * (*)(void *), void * );43 56 44 57 static inline void wake_fast(processor * this) { … … 71 84 // Threads 72 85 extern "C" { 73 void __cfactx_invoke_thread(void (*main)(void *), void * this); 86 forall(dtype T | is_thread(T)) 87 void CtxInvokeThread(T * this); 74 88 } 75 89 90 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst); 91 76 92 __cfaabi_dbg_debug_do( 77 extern void __cfaabi_dbg_thread_register ( $thread* thrd );78 extern void __cfaabi_dbg_thread_unregister( $thread* thrd );93 extern void __cfaabi_dbg_thread_register ( thread_desc * thrd ); 94 extern void __cfaabi_dbg_thread_unregister( thread_desc * thrd ); 79 95 ) 80 96 … … 83 99 #define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)] 84 100 85 static inline uint32_t __tls_rand() {86 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;87 kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;88 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 7;89 return kernelTLS.rand_seed;90 }91 92 101 93 102 void doregister( struct cluster & cltr ); 94 103 void unregister( struct cluster & cltr ); 95 104 96 void doregister( struct cluster * cltr, struct $thread& thrd );97 void unregister( struct cluster * cltr, struct $thread& thrd );105 void doregister( struct cluster * cltr, struct thread_desc & thrd ); 106 void unregister( struct cluster * cltr, struct thread_desc & thrd ); 98 107 99 108 void doregister( struct cluster * cltr, struct processor * proc );
Note:
See TracChangeset
for help on using the changeset viewer.