Statistics
| Branch: | Revision:

root / include / sysdep.h @ fbe00e73

History | View | Annotate | Download (514 Bytes)

1
/**
2
 * OS-dependent functionality.
3
 *
4
 * Copyright (c) 2010 Mircea Gherzan <mircea.gherzan@rwth-aachen.de>
5
 */
6
#ifndef SYSDEP_H
7
#define SYSDEP_H
8

    
9
#include <pthread.h>
10

    
11
#ifdef __cpluscplus
12
extern "C" {
13
#endif
14

    
15
/**
16
 * Set the affinity of the current thread to a certain CPU.
17
 * @param tid       thread id
18
 * @param cpu_idx   the index of the CPU
19
 * @return          0 on success, nonzero otherwise
20
 */
21
int thread_set_affinity(pthread_t tid, const unsigned cpu_idx);
22

    
23
#ifdef __cpluscplus
24
}
25
#endif
26

    
27
#endif // SYSDEP_H