X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcondvar.c;h=2e44efa8da1a8d779eb6e499be5a21f530ff2dfa;hp=e6292bdae2ca403937cd324bc257578eab9be7a9;hb=9afc8581574131c6d3ecea36c85740c07714318c;hpb=6143ea31aa0013f8a835b979b8444ef691d0d208 diff --git a/src/condvar.c b/src/condvar.c index e6292bd..2e44efa 100644 --- a/src/condvar.c +++ b/src/condvar.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ @@ -48,11 +48,14 @@ struct yaz_cond { void yaz_cond_create(YAZ_COND *p) { - *p = (YAZ_COND) malloc(sizeof(**p)); #ifdef WIN32 + *p = (YAZ_COND) malloc(sizeof(**p)); InitializeConditionVariable(&(*p)->cond); #elif YAZ_POSIX_THREADS + *p = (YAZ_COND) malloc(sizeof(**p)); pthread_cond_init(&(*p)->cond, 0); +#else + *p = 0; #endif }