Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(943)

Side by Side Diff: src/pkg/runtime/freebsd/thread.c

Issue 867046: code review 867046: runtime: fix build (panic) for FreeBSD (Closed)
Patch Set: code review 867046: runtime: fix build (panic) for FreeBSD Created 14 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/freebsd/os.h ('k') | src/pkg/runtime/runtime.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Use of this source file is governed by a BSD-style 1 // Use of this source file is governed by a BSD-style
2 // license that can be found in the LICENSE file.` 2 // license that can be found in the LICENSE file.`
3 3
4 #include "runtime.h" 4 #include "runtime.h"
5 #include "defs.h" 5 #include "defs.h"
6 #include "signals.h"
7 #include "os.h" 6 #include "os.h"
8 7
9 extern SigTab sigtab[]; 8 extern SigTab sigtab[];
9 extern int32 sys_umtx_op(uint32*, int32, uint32, void*, void*);
10 10
11 // FreeBSD's umtx_op syscall is effectively the same as Linux's futex, and 11 // FreeBSD's umtx_op syscall is effectively the same as Linux's futex, and
12 // thus the code is largely similar. See linux/thread.c for comments. 12 // thus the code is largely similar. See linux/thread.c for comments.
13 13
14 static void 14 static void
15 umtx_wait(uint32 *addr, uint32 val) 15 umtx_wait(uint32 *addr, uint32 val)
16 { 16 {
17 int32 ret; 17 int32 ret;
18 18
19 ret = sys_umtx_op(addr, UMTX_OP_WAIT, val, nil, nil); 19 ret = sys_umtx_op(addr, UMTX_OP_WAIT, val, nil, nil);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void· 95 void·
96 unlock(Lock *l) 96 unlock(Lock *l)
97 { 97 {
98 m->locks--; 98 m->locks--;
99 if(m->locks < 0) 99 if(m->locks < 0)
100 throw("lock count"); 100 throw("lock count");
101 umtx_unlock(l); 101 umtx_unlock(l);
102 } 102 }
103 103
104 void 104 void
105 destroylock(Lock *l) 105 destroylock(Lock*)
106 { 106 {
107 } 107 }
108 108
109 // Event notifications. 109 // Event notifications.
110 void 110 void
111 noteclear(Note *n) 111 noteclear(Note *n)
112 { 112 {
113 n->lock.key = 0; 113 n->lock.key = 0;
114 umtx_lock(&n->lock); 114 umtx_lock(&n->lock);
115 } 115 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 switch(g->sigcode0) { 188 switch(g->sigcode0) {
189 case FPE_INTDIV: 189 case FPE_INTDIV:
190 panicstring("integer divide by zero"); 190 panicstring("integer divide by zero");
191 case FPE_INTOVF: 191 case FPE_INTOVF:
192 panicstring("integer overflow"); 192 panicstring("integer overflow");
193 } 193 }
194 panicstring("floating point error"); 194 panicstring("floating point error");
195 } 195 }
196 panicstring(sigtab[g->sig].name); 196 panicstring(sigtab[g->sig].name);
197 } 197 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/freebsd/os.h ('k') | src/pkg/runtime/runtime.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b