My Project: dynamics.mod/NewtonDynamics/source/pthreads.2/tests/test.h File Reference

My Project

Macros | Variables
test.h File Reference
`#include "pthread.h"`
`#include "sched.h"`
`#include "semaphore.h"`
`#include <windows.h>`
`#include <stdio.h>`

Go to the source code of this file.

## Macros

#define | PTW32_THREAD_NULL_ID {NULL,0}
#define | rand_r(_seed) ( _seed == _seed? rand() : rand() )
#define | int64_t _int64
#define | PTW32_FTIME(x) _ftime(x)
#define | PTW32_STRUCT_TIMEB struct _timeb
#define | ASSERT_TRACE 0
#define | assert(e)
#define | assert_e(e, o, r)
#define | BEGIN_MUTEX_STALLED_ROBUST(mxAttr)
#define | END_MUTEX_STALLED_ROBUST(mxAttr)
#define | IS_ROBUST (_robust==PTHREAD_MUTEX_ROBUST)

## Variables

const char * | error_string []
int | assertE

## Macro Definition Documentation

## § assert

#define assert | ( |  | e | ) |

Value:
((e) ? ((ASSERT_TRACE) ? fprintf(stderr, \
"Assertion succeeded: (%s), file %s, line %d\n", \
#e, __FILE__, (int) __LINE__), \
fflush(stderr) : \
0) : \
(fprintf(stderr, "Assertion failed: (%s), file %s, line %d\n", \
#e, __FILE__, (int) __LINE__), exit(1), 0))
ASSERT_TRACE
#define ASSERT_TRACE
Definition: test.h:135

## § assert_e

#define assert_e | ( |  | e,
|  |  | o,
|  |  | r
| ) |  |

Value:
(((assertE = e) o (r)) ? ((ASSERT_TRACE) ? fprintf(stderr, \
"Assertion succeeded: (%s), file %s, line %d\n", \
#e, __FILE__, (int) __LINE__), \
fflush(stderr) : \
0) : \
(fprintf(stderr, "Assertion failed: (%s %s %s), file %s, line %d, error %s\n", \
#e,#o,#r, __FILE__, (int) __LINE__, error_string[assertE]), exit(1), 0))
error_string
const char * error_string[]
Definition: test.h:77
ASSERT_TRACE
#define ASSERT_TRACE
Definition: test.h:135
assertE
int assertE
Definition: test.h:150
o
pthread_once_t o
Definition: once2.c:49

## § ASSERT_TRACE

#define ASSERT_TRACE 0

## § BEGIN_MUTEX_STALLED_ROBUST

#define BEGIN_MUTEX_STALLED_ROBUST | ( |  | mxAttr | ) |

Value:
for(;;) \
{ \
static int _i=0; \
static int _robust; \
pthread_mutexattr_getrobust(&(mxAttr), &_robust);
mxAttr
pthread_mutexattr_t mxAttr
Definition: mutex1e.c:50

## § END_MUTEX_STALLED_ROBUST

#define END_MUTEX_STALLED_ROBUST | ( |  | mxAttr | ) |

Value:
printf("Pass %s\n", _robust==PTHREAD_MUTEX_ROBUST?"Robust":"Non-robust"); \
if (++_i > 1) \
break; \
else \
{ \
pthread_mutexattr_t *pma, *pmaEnd; \
for(pma = &(mxAttr), pmaEnd = pma + sizeof(mxAttr)/sizeof(pthread_mutexattr_t); \
pma < pmaEnd; \
pthread_mutexattr_setrobust(pma++, PTHREAD_MUTEX_ROBUST)); \
} \
}
PTHREAD_MUTEX_ROBUST
Definition: pthread.h:650
mxAttr
pthread_mutexattr_t mxAttr
Definition: mutex1e.c:50
pthread_mutexattr_t_
Definition: implement.h:261

## § int64_t

#define int64_t _int64

## § IS_ROBUST

#define IS_ROBUST (_robust==PTHREAD_MUTEX_ROBUST)

## § PTW32_FTIME

#define PTW32_FTIME | ( |  | x | ) | _ftime(x)

## § PTW32_STRUCT_TIMEB

#define PTW32_STRUCT_TIMEB struct _timeb

## § PTW32_THREAD_NULL_ID

#define PTW32_THREAD_NULL_ID {NULL,0}

## § rand_r

#define rand_r | ( |  | _seed | ) | ( _seed == _seed? rand() : rand() )

## Variable Documentation

## § assertE

int assertE

## § error_string

const char* error_string[]