diff options
author | lake4790k <lake4790k@users.noreply.github.com> | 2016-05-12 01:37:44 +0300 |
---|---|---|
committer | lake4790k <lake4790k@users.noreply.github.com> | 2016-05-13 13:23:41 +0300 |
commit | 8e8223d60d43468d327fbb8511d15e941aa0a9a6 (patch) | |
tree | 67a5c1c24d3c2d7855b487bc5197c31640791986 | |
parent | 628ab68498f4e3095709ee60a1bbd83cc4f0b556 (diff) |
support tds.AtomicCounter
-rw-r--r-- | sharedserialize.lua | 16 |
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 |