# define DEBUG_PT
#endif
-/* include asserts for now */
-#define DO_ASSERT
-
/* define the PDEBUG macro here */
#undef PDEBUG
#ifdef DEBUG_PT
# define PDEBUG(fmt, args...) /* debug switched off */
#endif
-/* nothing; placeholder to disable a PDEBUG message but don't delete it */
-#undef PDEBUGG
-#define PDEBUGG(fmt, args...)
-
-/* Define ASSERT to stop/warn. Should be void in production code */
-#undef ASSERT
-#ifdef DO_ASSERT
-# define ASSERT(x) if (!(x)) fprintf(stderr, "pt: assertion failed in %s:%i.\n",\
- __FILE__, __LINE__)
-#else
-# define ASSERT(x)
-#endif
-
#endif /* _PT_DEBUG_H */
extern int __libc_multiple_threads attribute_hidden;
extern int __librt_multiple_threads;
-/* Debugging */
-
-#ifdef DEBUG
-#include <assert.h>
-#define ASSERT assert
-#define MSG __pthread_message
-#else
-#define ASSERT(x)
-#define MSG(msg,arg...)
-#endif
-
/* Internal global functions */
void __pthread_destroy_specifics(void);
/* Synchronize debugging of the thread manager */
n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request,
sizeof(request)));
- ASSERT(n == sizeof(request) && request.req_kind == REQ_DEBUG);
#ifndef USE_SELECT
ufd.fd = reqfd;
ufd.events = POLLIN;
PDEBUG("before __libc_read\n");
n = __libc_read(reqfd, (char *)&request, sizeof(request));
PDEBUG("after __libc_read, n=%d\n", n);
- ASSERT(n == sizeof(request));
switch(request.req_kind) {
case REQ_CREATE:
PDEBUG("got REQ_CREATE\n");
pthread_readlock_info *iter, *next;
char *h_bottom_save;
- ASSERT(th->p_exited);
/* Make the handle invalid */
handle = thread_handle(th->p_tid);
__pthread_lock(&handle->h_lock, NULL);
static inline void enqueue(pthread_descr * q, pthread_descr th)
{
int prio = th->p_priority;
- ASSERT(th->p_nextwaiting == NULL);
for (; *q != NULL; q = &((*q)->p_nextwaiting)) {
if (prio > (*q)->p_priority) {
th->p_nextwaiting = *q;
if (maxprio == INT_MIN)
continue;
- ASSERT (p_max_prio != (struct wait_node *) 1);
-
/* Now we want to to remove the max priority thread's wait node from
the list. Before we can do this, we must atomically try to change the
node's abandon state from zero to nonzero. If we succeed, that means we