thread.h revision ec5347e2c775f027573ce5648b910361aa926c01
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: thread.h,v 1.21 2007/06/18 23:47:49 tbox Exp $ */
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
#include <windows.h>
/*
* Inlines to help with wait retrun checking
*/
/* check handle for NULL and INVALID_HANDLE */
}
/* validate wait return codes... */
return ((dwWaitResult >= WAIT_OBJECT_0) &&
}
return ((dwWaitResult >= WAIT_ABANDONED_0) &&
}
return (dwWaitResult == WAIT_TIMEOUT);
}
return (dwWaitResult == WAIT_FAILED);
}
/* compute object indices for waits... */
return (dwWaitResult - WAIT_OBJECT_0);
}
return (dwWaitResult - WAIT_ABANDONED_0);
}
typedef HANDLE isc_thread_t;
typedef unsigned int isc_threadresult_t;
typedef void * isc_threadarg_t;
typedef DWORD isc_thread_key_t;
#define isc_thread_self (unsigned long)GetCurrentThreadId
void
isc_thread_setconcurrency(unsigned int level);
int
int
void *
int
#endif /* ISC_THREAD_H */