int __vg_mutexkind;
} vg_pthread_mutexattr_t;
+typedef struct
+{
+ int __vg_pshared;
+} vg_pthread_condattr_t;
+
typedef struct _vg_pthread_rwlock_t
{
struct _vg_pthread_fastlock __vg_rw_lock; /* Lock to guarantee mutual exclusion */
info->arg = __arg;
sigprocmask(SIG_SETMASK, NULL, &info->sigmask);
- if (__vg_attr) {
+ if (__attr) {
si.base = (Addr)__vg_attr->__vg_stackaddr;
si.size = __vg_attr->__vg_stacksize;
si.guardsize = __vg_attr->__vg_guardsize;
int pthread_condattr_init(pthread_condattr_t *attr)
{
+ vg_pthread_condattr_t* vg_attr;
+ CONVERT(condattr, attr, vg_attr);
+
+ vg_attr->__vg_pshared = 0;
return 0;
}
{
return 0;
}
+
+int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
+{
+ static int moans = N_MOANS;
+ vg_pthread_condattr_t* vg_attr;
+ CONVERT(condattr, attr, vg_attr);
+
+ if (pshared != PTHREAD_PROCESS_PRIVATE &&
+ pshared != PTHREAD_PROCESS_SHARED)
+ return EINVAL;
+
+ if (pshared == PTHREAD_PROCESS_SHARED && moans-- > 0)
+ kludged("pthread_setschedparam", "(process shared condition variables not supported)");
+
+ vg_attr->__vg_pshared = pshared;
+ return 0;
+}
+
+int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
+{
+ vg_pthread_condattr_t* vg_attr;
+ CONVERT(condattr, attr, vg_attr);
+
+ *pshared = vg_attr->__vg_pshared;
+ return 0;
+}
int pthread_cond_init( pthread_cond_t *cond,
const pthread_condattr_t *cond_attr)
//void pthread_cond_timedwait ( void ) { unimp("pthread_cond_timedwait"); }
//void pthread_cond_wait ( void ) { unimp("pthread_cond_wait"); }
//void pthread_condattr_destroy ( void ) { unimp("pthread_condattr_destroy"); }
-void pthread_condattr_getpshared ( void ) { unimp("pthread_condattr_getpshared"); }
+//void pthread_condattr_getpshared ( void ) { unimp("pthread_condattr_getpshared"); }
//void pthread_condattr_init ( void ) { unimp("pthread_condattr_init"); }
-void pthread_condattr_setpshared ( void ) { unimp("pthread_condattr_setpshared"); }
+//void pthread_condattr_setpshared ( void ) { unimp("pthread_condattr_setpshared"); }
//void pthread_detach ( void ) { unimp("pthread_detach"); }
//void pthread_equal ( void ) { unimp("pthread_equal"); }
//void pthread_exit ( void ) { unimp("pthread_exit"); }