Back to index

glibc  2.9
Functions
td_ta_set_event.c File Reference
#include "thread_dbP.h"

Go to the source code of this file.

Functions

td_err_e td_ta_set_event (td_thragent_t *ta, td_thr_events_t *event) const

Function Documentation

td_err_e td_ta_set_event ( td_thragent_t *  ta,
td_thr_events_t event 
) const

Definition at line 25 of file td_ta_set_event.c.

{
  td_thr_events_t old_event;
  int i;

  LOG ("td_ta_set_event");

  /* Test whether the TA parameter is ok.  */
  if (! ta_ok (ta))
    return TD_BADTA;

  /* Write the new value into the thread data structure.  */
  if (ps_pdread (ta->ph, ta->pthread_threads_eventsp,
               &old_event, sizeof (td_thr_events_t)) != PS_OK)
    return TD_ERR;   /* XXX Other error value?  */

  /* Or the new bits in.  */
  for (i = 0; i < TD_EVENTSIZE; ++i)
    old_event.event_bits[i] |= event->event_bits[i];

  /* Write the new value into the thread data structure.  */
  if (ps_pdwrite (ta->ph, ta->pthread_threads_eventsp,
                &old_event, sizeof (td_thr_events_t)) != PS_OK)
    return TD_ERR;   /* XXX Other error value?  */

  return TD_OK;
}

Here is the call graph for this function: