Changeset a1a17a7 for src/libcfa/concurrency/kernel.c
- Timestamp:
- May 22, 2018, 4:39:48 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 13073be, 2c88368
- Parents:
- 639991a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel.c
r639991a ra1a17a7 49 49 thread_desc * mainThread; 50 50 51 struct { __dllist_t(thread_desc) list; __spinlock_t lock; } global_threads ;52 51 struct { __dllist_t(cluster ) list; __spinlock_t lock; } global_clusters; 53 52 … … 118 117 node.next = NULL; 119 118 node.prev = NULL; 120 doregister( this);119 doregister(curr_cluster, this); 121 120 122 121 monitors{ &self_mon_p, 1, (fptr_t)0 }; … … 167 166 procs{ __get }; 168 167 idles{ __get }; 168 threads{ __get }; 169 169 170 170 doregister(this); … … 518 518 __cfaabi_dbg_print_safe("Kernel : Starting\n"); 519 519 520 global_threads. list{ __get };521 global_threads. lock{};522 520 global_clusters.list{ __get }; 523 521 global_clusters.lock{}; … … 619 617 ^(mainThread){}; 620 618 619 ^(global_clusters.list){}; 620 ^(global_clusters.lock){}; 621 621 622 __cfaabi_dbg_print_safe("Kernel : Shutdown complete\n"); 622 623 } … … 756 757 //----------------------------------------------------------------------------- 757 758 // Global Queues 758 void doregister( thread_desc & thrd ) {759 lock ( global_threads.lock __cfaabi_dbg_ctx2);760 push_front( global_threads.list, thrd );761 unlock ( global_threads.lock );762 }763 764 void unregister( thread_desc & thrd ) {765 lock ( global_threads.lock __cfaabi_dbg_ctx2);766 remove( global_threads.list, thrd );767 unlock( global_threads.lock );768 }769 770 759 void doregister( cluster & cltr ) { 771 760 lock ( global_clusters.lock __cfaabi_dbg_ctx2); … … 780 769 } 781 770 771 void doregister( cluster * cltr, thread_desc & thrd ) { 772 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 773 push_front(cltr->threads, thrd); 774 unlock (cltr->thread_list_lock); 775 } 776 777 void unregister( cluster * cltr, thread_desc & thrd ) { 778 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 779 remove(cltr->threads, thrd ); 780 unlock(cltr->thread_list_lock); 781 } 782 782 783 783 void doregister( cluster * cltr, processor * proc ) {
Note: See TracChangeset
for help on using the changeset viewer.