OLD | NEW |
---|---|
(Empty) | |
1 package impl; | |
2 | |
3 /* | |
4 #include "mojo/public/platform/native/system_thunks.h" | |
5 */ | |
6 import "C" | |
7 import "mojo/public/go/mojo/system" | |
8 | |
9 | |
10 type CoreImpl struct { | |
11 } | |
12 | |
13 func (c CoreImpl) GetTimeTicksNow() int64 { | |
qsr
2014/09/22 11:11:25
Do you have typedef or equivalent in go? I underst
tburkard
2014/09/22 14:23:17
I will address this in a follow-on change, which I
| |
14 return (int64)(C.MojoGetTimeTicksNow()); | |
15 } | |
16 | |
17 var lazyInstance *CoreImpl = nil; | |
18 | |
19 func GetCore() system.Core { | |
20 if lazyInstance == nil { | |
qsr
2014/09/22 11:11:25
Do you need any kind of thread safety here?
tburkard
2014/09/22 14:23:17
I will address this in a follow-on change, which I
| |
21 lazyInstance = new(CoreImpl); | |
22 } | |
23 return lazyInstance; | |
24 } | |
OLD | NEW |