Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/threads-ffi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlake4790k <lake4790k@users.noreply.github.com>2016-05-12 01:37:44 +0300
committerlake4790k <lake4790k@users.noreply.github.com>2016-05-13 13:23:41 +0300
commit8e8223d60d43468d327fbb8511d15e941aa0a9a6 (patch)
tree67a5c1c24d3c2d7855b487bc5197c31640791986
parent628ab68498f4e3095709ee60a1bbd83cc4f0b556 (diff)
support tds.AtomicCounter
-rw-r--r--sharedserialize.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/sharedserialize.lua b/sharedserialize.lua
index 17d18b6..c34684e 100644
--- a/sharedserialize.lua
+++ b/sharedserialize.lua
@@ -59,6 +59,22 @@ if tds then
function mt.__read(self, f)
end
typenames['tds.Vec'] = mt
+
+ -- atomic
+ local mt = {}
+ function mt.__factory(f)
+ local self = deserializePointer(f)
+ self = ffi.cast('tds_atomic_counter&', self)
+ ffi.gc(self, tds.C.tds_atomic_free)
+ return self
+ end
+ function mt.__write(self, f)
+ serializePointer(self, f)
+ tds.C.tds_atomic_retain(self)
+ end
+ function mt.__read(self, f)
+ end
+ typenames['tds.AtomicCounter'] = mt
end
-- tensor support