Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct threadsafefile: lock, file {}
- class worker: thread {
- threadsafefile* file
- run
- file.lock()
- file.append("stuff")
- file.unlock()
- }
- main
- threadsafefile a("path", "rw", IO_APPEND)
- for i = 0, 255
- for y 0, 255 do
- worker b
- b.file = a
- b.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement