]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/tsan/SharedLibs/load_shared_lib-so.cc
Imported Upstream version 1.5.0+dfsg1
[rustc.git] / src / compiler-rt / test / tsan / SharedLibs / load_shared_lib-so.cc
CommitLineData
1a4d82fc 1//===----------- load_shared_lib-so.cc --------------------------*- C++ -*-===//
223e47cc
LB
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
1a4d82fc 10// This file is a part of ThreadSanitizer (TSan), a race detector.
223e47cc
LB
11//
12//===----------------------------------------------------------------------===//
13
1a4d82fc
JJ
14#include <stddef.h>
15#include <unistd.h>
223e47cc 16
1a4d82fc 17int GLOB_SHARED = 0;
223e47cc 18
1a4d82fc
JJ
19extern "C"
20void *write_from_so(void *unused) {
21 if (unused)
22 sleep(1);
23 GLOB_SHARED++;
24 return NULL;
223e47cc 25}