// // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // monitor -- // // Author : Thierry Delisle // Created On : Thd Feb 23 12:27:26 2017 // Last Modified By : Peter A. Buhr // Last Modified On : Sat Jul 22 09:59:01 2017 // Update Count : 3 // #pragma once #include #include #include "invoke.h" #include "stdlib" trait is_monitor(dtype T) { monitor_desc * get_monitor( T & ); void ^?{}( T & mutex ); }; static inline void ?{}(monitor_desc & this) { (this.lock){}; this.owner = NULL; (this.entry_queue){}; (this.signal_stack){}; this.recursion = 0; this.mask.accepted = NULL; this.mask.clauses = NULL; this.mask.size = 0; } struct monitor_guard_t { monitor_desc ** m; int count; monitor_desc ** prev_mntrs; unsigned short prev_count; fptr_t prev_func; }; static inline int ?blocked.head; } uintptr_t front( condition * this ); //----------------------------------------------------------------------------- // External scheduling struct __acceptable_t { __monitor_group_t; bool is_dtor; }; void __waitfor_internal( const __waitfor_mask_t & mask, int duration ); // Local Variables: // // mode: c // // tab-width: 4 // // End: //