OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // +build darwin netbsd openbsd plan9 windows | 5 // +build darwin netbsd openbsd plan9 windows |
6 | 6 |
7 #include "runtime.h" | 7 #include "runtime.h" |
8 #include "stack.h" | 8 #include "stack.h" |
9 | 9 |
10 // This implementation depends on OS-specific implementations of | 10 // This implementation depends on OS-specific implementations of |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // Wakeup happened so semaphore is available. | 224 // Wakeup happened so semaphore is available. |
225 // Grab it to avoid getting out of sync. | 225 // Grab it to avoid getting out of sync. |
226 if(runtime·semasleep(-1) < 0) | 226 if(runtime·semasleep(-1) < 0) |
227 runtime·throw("runtime: unable to acquire - sema
phore out of sync"); | 227 runtime·throw("runtime: unable to acquire - sema
phore out of sync"); |
228 return true; | 228 return true; |
229 } else { | 229 } else { |
230 runtime·throw("runtime: unexpected waitm - semaphore out
of sync"); | 230 runtime·throw("runtime: unexpected waitm - semaphore out
of sync"); |
231 } | 231 } |
232 } | 232 } |
233 } | 233 } |
| 234 |
| 235 bool |
| 236 runtime·notetsleepg(Note *n, int64 ns) |
| 237 { |
| 238 bool res; |
| 239 |
| 240 if(g == m->g0) |
| 241 runtime·throw("notetsleepg on g0"); |
| 242 runtime·entersyscallblock(); |
| 243 res = runtime·notetsleep(n, ns); |
| 244 runtime·exitsyscall(); |
| 245 return res; |
| 246 } |
OLD | NEW |