Description:
added more comments on dir_init.rb
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@383 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r180:a8ad25e1c3fc - - 1 file changed: 19 inserted, 0 deleted
@@ -12,6 +12,25 | |||||
|
12 | # This library maintain a reference counter on the processes using the |
|
12 | # This library maintain a reference counter on the processes using the |
|
13 | # directory. It locks the dir to manage critical section when |
|
13 | # directory. It locks the dir to manage critical section when |
|
14 | # updating the reference counter. |
|
14 | # updating the reference counter. |
|
|
15 | + # | ||
|
|
16 | + # Example usage: | ||
|
|
17 | + # | ||
|
|
18 | + # dman = DirInit::Manager.new("mydir") | ||
|
|
19 | + # | ||
|
|
20 | + # dman.setup do | ||
|
|
21 | + # # do some initialization | ||
|
|
22 | + # end | ||
|
|
23 | + # | ||
|
|
24 | + # #... do anything you want | ||
|
|
25 | + # | ||
|
|
26 | + # dman.teardown do | ||
|
|
27 | + # # clean up | ||
|
|
28 | + # end | ||
|
|
29 | + # | ||
|
|
30 | + # DirInit::Manager ensures that the block passed to <tt>setup</tt> | ||
|
|
31 | + # only runs once by the first process in the concurrent dir usage and | ||
|
|
32 | + # block passed to <tt>teardown</tt> runs once by the last process in | ||
|
|
33 | + # that concurrent activities leaving that dir. | ||
|
15 |
|
34 | ||
|
16 | module DirInit |
|
35 | module DirInit |
|
17 |
|
36 |
You need to be logged in to leave comments.
Login now