Gabe Schaffer wrote:
On Wed, 17 Nov 2004 16:30:04 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote:

Gabe Schaffer <[EMAIL PROTECTED]> wrote:
The problem is a different one: the COND_INIT macro just passes a
condition location, the mutex is created in a second step, which isn't
needed for windows. OTOH a mutex aka critical section is needed
separatly.

So we should probably define these macros to be:

COND_INIT(c, m)
COND_DESTROY(c, m)

see src/tsq.c for usage.

Does win32 require more info to create conditions/mutexes or would these
macros suffice?


Win32 doesn't require anything else, but I don't think I like this
idea. If you do COND_INIT(c, m) and Win32 ignores the 'm', what
happens when some code goes to LOCK(m)? It would work under POSIX but
break under Win32.

The mutex in COND_INIT is specific to that condition, it can't get reused in unrelated places. But it is used to synchronize {push,pop, wait_for}_entry. How is e.g. tsq.c:push_entry() synchronized then on Win32?


... I think there should be an opaque struct that
contains c,m for POSIX and c for Win32.

Works for me too, modulo above sync issues.

GNS

leo



Reply via email to