123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <stddef.h>
- #include "thread_dbP.h"
- td_err_e
- td_thr_set_event(const td_thrhandle_t *th, td_thr_events_t *event)
- {
- td_thr_events_t old_event;
- int i;
- LOG ("td_thr_set_event");
-
- if (th->th_unique == NULL)
- return TD_NOTALLOC;
-
- if (ps_pdread (th->th_ta_p->ph,
- ((char *) th->th_unique
- + offsetof (struct _pthread_descr_struct,
- p_eventbuf.eventmask)),
- &old_event, sizeof (td_thr_events_t)) != PS_OK)
- return TD_ERR;
-
- for (i = 0; i < TD_EVENTSIZE; ++i)
- old_event.event_bits[i] |= event->event_bits[i];
-
- if (ps_pdwrite (th->th_ta_p->ph,
- ((char *) th->th_unique
- + offsetof (struct _pthread_descr_struct,
- p_eventbuf.eventmask)),
- &old_event, sizeof (td_thr_events_t)) != PS_OK)
- return TD_ERR;
- return TD_OK;
- }
|