mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-08 04:55:52 +00:00
threads to have thread-private data which is quickly accessible via a segment in the GDT, stored in %gs. The patch implements the relevent syscalls (setthreadarea), and also manages switching the VCPU's segment information at thread context-switch time. Mostly Tom Hughes' work. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2215
21 lines
259 B
C
21 lines
259 B
C
#include <pthread.h>
|
|
|
|
extern __thread int so_extern;
|
|
static __thread int so_local;
|
|
extern __thread int global;
|
|
|
|
int *test_so_extern(void)
|
|
{
|
|
return &so_extern;
|
|
}
|
|
|
|
int *test_so_local(void)
|
|
{
|
|
return &so_local;
|
|
}
|
|
|
|
int *test_so_global(void)
|
|
{
|
|
return &global;
|
|
}
|