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

Side by Side Diff: src/pkg/runtime/time.goc

Issue 11681043: code review 11681043: runtime: introduce notetsleepg function (Closed)
Patch Set: diff -r f454ddfc8968 https://dvyukov%40google.com@code.google.com/p/go/ Created 10 years, 8 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/sigqueue.goc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 // Time-related runtime and pieces of package time. 5 // Time-related runtime and pieces of package time.
6 6
7 package time 7 package time
8 8
9 #include "runtime.h" 9 #include "runtime.h"
10 #include "defs_GOOS_GOARCH.h" 10 #include "defs_GOOS_GOARCH.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if(delta < 0) { 207 if(delta < 0) {
208 // No timers left - put goroutine to sleep. 208 // No timers left - put goroutine to sleep.
209 timers.rescheduling = true; 209 timers.rescheduling = true;
210 runtime·park(runtime·unlock, &timers, "timer goroutine ( idle)"); 210 runtime·park(runtime·unlock, &timers, "timer goroutine ( idle)");
211 continue; 211 continue;
212 } 212 }
213 // At least one timer pending. Sleep until then. 213 // At least one timer pending. Sleep until then.
214 timers.sleeping = true; 214 timers.sleeping = true;
215 runtime·noteclear(&timers.waitnote); 215 runtime·noteclear(&timers.waitnote);
216 runtime·unlock(&timers); 216 runtime·unlock(&timers);
217 » » runtime·entersyscallblock(); 217 » » runtime·notetsleepg(&timers.waitnote, delta);
218 » » runtime·notetsleep(&timers.waitnote, delta);
219 » » runtime·exitsyscall();
220 } 218 }
221 } 219 }
222 220
223 // heap maintenance algorithms. 221 // heap maintenance algorithms.
224 222
225 static void 223 static void
226 siftup(int32 i) 224 siftup(int32 i)
227 { 225 {
228 int32 p; 226 int32 p;
229 Timer **t, *tmp; 227 Timer **t, *tmp;
(...skipping 30 matching lines...) Expand all
260 if(t[c]->when >= t[i]->when) 258 if(t[c]->when >= t[i]->when)
261 break; 259 break;
262 tmp = t[i]; 260 tmp = t[i];
263 t[i] = t[c]; 261 t[i] = t[c];
264 t[c] = tmp; 262 t[c] = tmp;
265 t[i]->i = i; 263 t[i]->i = i;
266 t[c]->i = c; 264 t[c]->i = c;
267 i = c; 265 i = c;
268 } 266 }
269 } 267 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/sigqueue.goc ('k') | no next file » | no next file with comments »

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