~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/time/timer_delete.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <time.h>
 
2
#include <limits.h>
 
3
#include "pthread_impl.h"
 
4
 
 
5
int timer_delete(timer_t t)
 
6
{
 
7
        if ((intptr_t)t < 0) {
 
8
                pthread_t td = (void *)((uintptr_t)t << 1);
 
9
                a_store(&td->timer_id, td->timer_id | INT_MIN);
 
10
                __wake(&td->timer_id, 1, 1);
 
11
                return 0;
 
12
        }
 
13
        return __syscall(SYS_timer_delete, (long)t);
 
14
}