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

Delta Between Two Patch Sets: src/pkg/runtime/windows/thread.c

Issue 5392041: code review 5392041: time: new Time, Duration, ZoneInfo types (Closed)
Left Patch Set: Created 13 years, 4 months ago
Right Patch Set: diff -r 3c286b9b2206 https://go.googlecode.com/hg/ Created 13 years, 3 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/time.goc ('k') | src/pkg/time/Makefile » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 #include "runtime.h" 5 #include "runtime.h"
6 #include "type.h" 6 #include "type.h"
7 #include "defs.h" 7 #include "defs.h"
8 #include "os.h" 8 #include "os.h"
9 9
10 #pragma dynimport runtime·CloseHandle CloseHandle "kernel32.dll" 10 #pragma dynimport runtime·CloseHandle CloseHandle "kernel32.dll"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 { 212 {
213 int64 filetime; 213 int64 filetime;
214 214
215 runtime·stdcall(runtime·GetSystemTimeAsFileTime, 1, &filetime); 215 runtime·stdcall(runtime·GetSystemTimeAsFileTime, 1, &filetime);
216 216
217 // Filetime is 100s of nanoseconds since January 1, 1601. 217 // Filetime is 100s of nanoseconds since January 1, 1601.
218 // Convert to nanoseconds since January 1, 1970. 218 // Convert to nanoseconds since January 1, 1970.
219 return (filetime - 116444736000000000LL) * 100LL; 219 return (filetime - 116444736000000000LL) * 100LL;
220 } 220 }
221 221
222 void
223 time·now(int64 sec, int32 usec)
224 {
225 int64 ns;
226 ········
227 ns = runtime·nanotime();
228 sec = ns / 1000000000LL;
229 usec = ns - sec * 1000000000LL;
230 FLUSH(&sec);
231 FLUSH(&usec);
232 }
233
222 // Calling stdcall on os stack. 234 // Calling stdcall on os stack.
223 #pragma textflag 7 235 #pragma textflag 7
224 void * 236 void *
225 runtime·stdcall(void *fn, int32 count, ...) 237 runtime·stdcall(void *fn, int32 count, ...)
226 { 238 {
227 WinCall c; 239 WinCall c;
228 240
229 c.fn = fn; 241 c.fn = fn;
230 c.n = count; 242 c.n = count;
231 c.args = (uintptr*)&count + 1; 243 c.args = (uintptr*)&count + 1;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 runtime·stdcall(runtime·SetWaitableTimer, 6, 401 runtime·stdcall(runtime·SetWaitableTimer, 6,
390 profiletimer, &due, (uintptr)ms, nil, nil, nil); 402 profiletimer, &due, (uintptr)ms, nil, nil, nil);
391 runtime·atomicstore((uint32*)&m->profilehz, hz); 403 runtime·atomicstore((uint32*)&m->profilehz, hz);
392 } 404 }
393 405
394 void 406 void
395 os·sigpipe(void) 407 os·sigpipe(void)
396 { 408 {
397 runtime·throw("too many writes on closed pipe"); 409 runtime·throw("too many writes on closed pipe");
398 } 410 }
LEFTRIGHT

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