style cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40547 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,7 +15,8 @@ static bool blocking[4];
|
|||||||
static pthread_key_t self;
|
static pthread_key_t self;
|
||||||
|
|
||||||
|
|
||||||
static void suspendLoop(int *i) {
|
static void
|
||||||
|
suspendLoop(int *i) {
|
||||||
sigjmp_buf env;
|
sigjmp_buf env;
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
|
|
||||||
@@ -34,12 +35,15 @@ static void suspendLoop(int *i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void suspendHandler(int sig) {
|
static void
|
||||||
|
suspendHandler(int sig) {
|
||||||
int *i = (int*)pthread_getspecific(self);
|
int *i = (int*)pthread_getspecific(self);
|
||||||
suspendLoop(i);
|
suspendLoop(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initialiseSignals()
|
|
||||||
|
static void
|
||||||
|
initialiseSignals()
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
@@ -57,7 +61,8 @@ static void initialiseSignals()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void self_suspend(int* i)
|
static void
|
||||||
|
self_suspend(int* i)
|
||||||
{
|
{
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
|
|
||||||
@@ -77,7 +82,9 @@ static void self_suspend(int* i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *threadStart(void *arg) {
|
void *
|
||||||
|
threadStart(void *arg)
|
||||||
|
{
|
||||||
int *i = (int*)arg;
|
int *i = (int*)arg;
|
||||||
pthread_setspecific(self, i);
|
pthread_setspecific(self, i);
|
||||||
|
|
||||||
@@ -94,7 +101,8 @@ void *threadStart(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*void suspendAllThreads()
|
/*void
|
||||||
|
suspendAllThreads()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
blocking[i] = false;
|
blocking[i] = false;
|
||||||
@@ -111,7 +119,8 @@ void *threadStart(void *arg) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void resumeAllThreads()
|
void
|
||||||
|
resumeAllThreads()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
blocking[i] = true;
|
blocking[i] = true;
|
||||||
@@ -130,7 +139,8 @@ void resumeAllThreads()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
initialiseSignals();
|
initialiseSignals();
|
||||||
|
|
||||||
@@ -152,3 +162,4 @@ int main(int argc, char **argv)
|
|||||||
resumeAllThreads();
|
resumeAllThreads();
|
||||||
printf("resuming all threads done\n");
|
printf("resuming all threads done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user