Skip to content

Commit

Permalink
[core.counter] Allow passing of readonly option to core.shm.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Jul 9, 2015
1 parent b2cc0fa commit a3ffff3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/counter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ require("core.counter_h")

local counter_t = ffi.typeof("struct counter")

function open (name) return shm.map(name, counter_t) end
function set (counter, value) counter.c = value end
function add (counter, value) counter.c = counter.c + value end
function read (counter) return counter.c end
function open (name, readonly) return shm.map(name, counter_t, readonly) end
function set (counter, value) counter.c = value end
function add (counter, value) counter.c = counter.c + value end
function read (counter) return counter.c end

function selftest ()
print("selftest: core.counter")
Expand Down

0 comments on commit a3ffff3

Please sign in to comment.