﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
95	Incorrect consideration of global and local variables in resolving waitfor mutex object.	Thierry Delisle		"The following code :
{{{
#include <monitor.hfa>
monitor M { condition e; } m;
void rtn( M & mutex m );
void bar( M & mutex m ) {
 	waitfor( rtn : m ); // not ambiguous, select parameter
}
}}}


Produces the following error:

{{{
cfa test.c
CFA Version 1.0.0 (debug)
test.c:92:1 error: Ambiguous function in call to waitfor
}}}

If mangling is removed for {{{mutex}}} then the following code encounters widening problems:
{{{
//----------
struct monitor_desc {};

struct monitor_guard_t {};
void ?{}( monitor_guard_t & this, monitor_desc ** m, int count, void (*func)() );

struct monitor_dtor_guard_t {};
void ?{}( monitor_dtor_guard_t & this, monitor_desc ** m, void (*func)() );

//----------
forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void delete( T * ptr );

//----------
monitor test {};

int main() {
	test * t = 0;
	delete(t);
}
}}}
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."	defect	assigned	major	cfa-cc	1.0		resolver	
