| 19 | |
| 20 | If mangling is removed for {{{mutex}}} then the following code encounters widening problems: |
| 21 | {{{ |
| 22 | //---------- |
| 23 | struct monitor_desc {}; |
| 24 | |
| 25 | struct monitor_guard_t {}; |
| 26 | void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() ); |
| 27 | |
| 28 | struct monitor_dtor_guard_t {}; |
| 29 | void ?{}( monitor_dtor_guard_t & this, monitor_desc ** m, void (*func)() ); |
| 30 | |
| 31 | //---------- |
| 32 | forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void delete( T * ptr ); |
| 33 | |
| 34 | //---------- |
| 35 | monitor test {}; |
| 36 | |
| 37 | int main() { |
| 38 | test * t = 0; |
| 39 | delete(t); |
| 40 | } |
| 41 | }}} |
| 42 | Note the {{{monitor_guard_t}}} and {{{monitor_dtor_guard_t}}} structs are needed because they are expected by the code handling the mutex and monitor keywords. |