Index: mojo/go/system/impl/core_impl.go |
diff --git a/mojo/go/system/impl/core_impl.go b/mojo/go/system/impl/core_impl.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5c34b2ee747d82b6ffbb4d50ceb0c1c2d1309df0 |
--- /dev/null |
+++ b/mojo/go/system/impl/core_impl.go |
@@ -0,0 +1,24 @@ |
+package impl; |
+ |
+/* |
+#include "mojo/public/platform/native/system_thunks.h" |
+*/ |
+import "C" |
+import "mojo/public/go/mojo/system" |
+ |
+ |
+type CoreImpl struct { |
+} |
+ |
+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
|
+ return (int64)(C.MojoGetTimeTicksNow()); |
+} |
+ |
+var lazyInstance *CoreImpl = nil; |
+ |
+func GetCore() system.Core { |
+ 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
|
+ lazyInstance = new(CoreImpl); |
+ } |
+ return lazyInstance; |
+} |