Advertisement
WeltEnSTurm

Untitled

Dec 19th, 2011
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. struct threadsafefile: lock, file {}
  2.  
  3. class worker: thread {
  4. threadsafefile* file
  5. run
  6. file.lock()
  7. file.append("stuff")
  8. file.unlock()
  9. }
  10.  
  11. main
  12. threadsafefile a("path", "rw", IO_APPEND)
  13. for i = 0, 255
  14. for y 0, 255 do
  15. worker b
  16. b.file = a
  17. b.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement