summaryrefslogtreecommitdiff
blob: b284da8f3e790a3dd8c22762686e6c80868c5ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
http://bugs.gentoo.org/419563
http://bugs.gentoo.org/419971

See -gcc47-patch and -magic.patch in Fedora git:

http://pkgs.fedoraproject.org/gitweb/?p=libwvstreams.git;a=tree

--- include/wvtask.h
+++ include/wvtask.h
@@ -45,7 +45,8 @@
     typedef void TaskFunc(void *userdata);
     
     static int taskcount, numtasks, numrunning;
-    int magic_number, *stack_magic;
+    int volatile magic_number;
+    int *stack_magic;
     WvString name;
     int tid;
     
@@ -84,7 +85,7 @@
     static WvTaskMan *singleton;
     static int links;
     
-    static int magic_number;
+    static int volatile magic_number;
     static WvTaskList all_tasks, free_tasks;
     
     static void get_stack(WvTask &task, size_t size);
--- include/wvuid.h
+++ include/wvuid.h
@@ -7,6 +7,7 @@
 #ifndef __WVUID_H
 #define __WVUID_H
 
+#include <unistd.h>
 #include "wvstring.h"
 
 #if WIN32
--- utils/wvtask.cc
+++ utils/wvtask.cc
@@ -58,7 +58,8 @@
 int WvTask::taskcount, WvTask::numtasks, WvTask::numrunning;
 
 WvTaskMan *WvTaskMan::singleton;
-int WvTaskMan::links, WvTaskMan::magic_number;
+int WvTaskMan::links;
+int volatile WvTaskMan::magic_number;
 WvTaskList WvTaskMan::all_tasks, WvTaskMan::free_tasks;
 ucontext_t WvTaskMan::stackmaster_task, WvTaskMan::get_stack_return,
     WvTaskMan::toplevel;