fsdb 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/History.txt +6 -0
  2. data/README.txt +1 -1
  3. data/lib/fsdb/database.rb +1 -1
  4. data/rakefile +5 -3
  5. data/test/test-concurrency.rb +5 -3
  6. data/test/test-formats.rb +3 -1
  7. data/test/test-fsdb.rb +5 -3
  8. metadata +10 -148
  9. data/junk/OLDRakefile +0 -98
  10. data/junk/OLDRakefile2 +0 -55
  11. data/junk/check-cache.rb +0 -18
  12. data/junk/create-lock.rb +0 -25
  13. data/junk/doc/old-api/classes/FSDB.html +0 -139
  14. data/junk/doc/old-api/classes/FSDB/Database.html +0 -953
  15. data/junk/doc/old-api/classes/FSDB/Database.src/M000029.html +0 -16
  16. data/junk/doc/old-api/classes/FSDB/Database.src/M000030.html +0 -16
  17. data/junk/doc/old-api/classes/FSDB/Database.src/M000031.html +0 -16
  18. data/junk/doc/old-api/classes/FSDB/Database.src/M000032.html +0 -16
  19. data/junk/doc/old-api/classes/FSDB/Database.src/M000033.html +0 -33
  20. data/junk/doc/old-api/classes/FSDB/Database.src/M000034.html +0 -18
  21. data/junk/doc/old-api/classes/FSDB/Database.src/M000035.html +0 -22
  22. data/junk/doc/old-api/classes/FSDB/Database.src/M000036.html +0 -16
  23. data/junk/doc/old-api/classes/FSDB/Database.src/M000037.html +0 -22
  24. data/junk/doc/old-api/classes/FSDB/Database.src/M000038.html +0 -43
  25. data/junk/doc/old-api/classes/FSDB/Database.src/M000039.html +0 -25
  26. data/junk/doc/old-api/classes/FSDB/Database.src/M000040.html +0 -43
  27. data/junk/doc/old-api/classes/FSDB/Database.src/M000041.html +0 -23
  28. data/junk/doc/old-api/classes/FSDB/Database.src/M000042.html +0 -22
  29. data/junk/doc/old-api/classes/FSDB/Database.src/M000043.html +0 -16
  30. data/junk/doc/old-api/classes/FSDB/Database.src/M000044.html +0 -16
  31. data/junk/doc/old-api/classes/FSDB/Database.src/M000045.html +0 -18
  32. data/junk/doc/old-api/classes/FSDB/Database.src/M000046.html +0 -18
  33. data/junk/doc/old-api/classes/FSDB/Database.src/M000047.html +0 -18
  34. data/junk/doc/old-api/classes/FSDB/Database.src/M000048.html +0 -16
  35. data/junk/doc/old-api/classes/FSDB/Database.src/M000049.html +0 -71
  36. data/junk/doc/old-api/classes/FSDB/Database.src/M000050.html +0 -43
  37. data/junk/doc/old-api/classes/FSDB/Database.src/M000051.html +0 -53
  38. data/junk/doc/old-api/classes/FSDB/Database.src/M000052.html +0 -44
  39. data/junk/doc/old-api/classes/FSDB/Database.src/M000053.html +0 -39
  40. data/junk/doc/old-api/classes/FSDB/Database.src/M000054.html +0 -72
  41. data/junk/doc/old-api/classes/FSDB/Database.src/M000055.html +0 -39
  42. data/junk/doc/old-api/classes/FSDB/Database.src/M000056.html +0 -18
  43. data/junk/doc/old-api/classes/FSDB/Database.src/M000057.html +0 -18
  44. data/junk/doc/old-api/classes/FSDB/Database.src/M000058.html +0 -18
  45. data/junk/doc/old-api/classes/FSDB/Database.src/M000059.html +0 -18
  46. data/junk/doc/old-api/classes/FSDB/Database.src/M000060.html +0 -18
  47. data/junk/doc/old-api/classes/FSDB/Database.src/M000061.html +0 -23
  48. data/junk/doc/old-api/classes/FSDB/Database.src/M000062.html +0 -23
  49. data/junk/doc/old-api/classes/FSDB/Database.src/M000063.html +0 -18
  50. data/junk/doc/old-api/classes/FSDB/Database.src/M000064.html +0 -18
  51. data/junk/doc/old-api/classes/FSDB/Database/AbortedTransaction.html +0 -118
  52. data/junk/doc/old-api/classes/FSDB/Database/CreateFileError.html +0 -120
  53. data/junk/doc/old-api/classes/FSDB/Database/DirIsImmutableError.html +0 -117
  54. data/junk/doc/old-api/classes/FSDB/Database/DirNotEmptyError.html +0 -117
  55. data/junk/doc/old-api/classes/FSDB/Database/FormatError.html +0 -117
  56. data/junk/doc/old-api/classes/FSDB/Database/MissingFileError.html +0 -117
  57. data/junk/doc/old-api/classes/FSDB/Database/MissingObjectError.html +0 -117
  58. data/junk/doc/old-api/classes/FSDB/Database/NotDirError.html +0 -118
  59. data/junk/doc/old-api/classes/FSDB/Database/PathComponentError.html +0 -120
  60. data/junk/doc/old-api/classes/FSDB/DatabaseDebuggable.html +0 -148
  61. data/junk/doc/old-api/classes/FSDB/DatabaseDebuggable.src/M000005.html +0 -21
  62. data/junk/doc/old-api/classes/FSDB/DatabaseDebuggable.src/M000007.html +0 -21
  63. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.html +0 -210
  64. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000006.html +0 -22
  65. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000007.html +0 -22
  66. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000008.html +0 -22
  67. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000009.html +0 -22
  68. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000010.html +0 -22
  69. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000011.html +0 -22
  70. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000012.html +0 -22
  71. data/junk/doc/old-api/classes/FSDB/DirectoryIterators.src/M000013.html +0 -22
  72. data/junk/doc/old-api/classes/FSDB/ForkSafely.html +0 -126
  73. data/junk/doc/old-api/classes/FSDB/Modex.html +0 -237
  74. data/junk/doc/old-api/classes/FSDB/Modex.src/M000024.html +0 -21
  75. data/junk/doc/old-api/classes/FSDB/Modex.src/M000025.html +0 -30
  76. data/junk/doc/old-api/classes/FSDB/Modex.src/M000026.html +0 -21
  77. data/junk/doc/old-api/classes/FSDB/Modex.src/M000027.html +0 -30
  78. data/junk/doc/old-api/classes/FSDB/Modex.src/M000028.html +0 -44
  79. data/junk/doc/old-api/classes/FSDB/Modex.src/M000029.html +0 -26
  80. data/junk/doc/old-api/classes/FSDB/Modex.src/M000030.html +0 -48
  81. data/junk/doc/old-api/classes/FSDB/Modex/ForkSafely.html +0 -105
  82. data/junk/doc/old-api/classes/FSDB/Mutex.html +0 -244
  83. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000018.html +0 -19
  84. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000019.html +0 -18
  85. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000020.html +0 -19
  86. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000021.html +0 -18
  87. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000022.html +0 -23
  88. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000023.html +0 -30
  89. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000024.html +0 -26
  90. data/junk/doc/old-api/classes/FSDB/Mutex.src/M000025.html +0 -21
  91. data/junk/doc/old-api/classes/FSDB/Mutex/ForkSafely.html +0 -105
  92. data/junk/doc/old-api/classes/FSDB/PathUtilities.html +0 -257
  93. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000012.html +0 -23
  94. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000013.html +0 -18
  95. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000014.html +0 -23
  96. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000015.html +0 -18
  97. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000016.html +0 -18
  98. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000017.html +0 -22
  99. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000018.html +0 -23
  100. data/junk/doc/old-api/classes/FSDB/PathUtilities.src/M000019.html +0 -18
  101. data/junk/doc/old-api/classes/FSDB/PathUtilities/InvalidPathError.html +0 -111
  102. data/junk/doc/old-api/classes/File.html +0 -272
  103. data/junk/doc/old-api/classes/File.src/M000001.html +0 -17
  104. data/junk/doc/old-api/classes/File.src/M000002.html +0 -17
  105. data/junk/doc/old-api/classes/File.src/M000003.html +0 -20
  106. data/junk/doc/old-api/classes/File.src/M000004.html +0 -20
  107. data/junk/doc/old-api/classes/File.src/M000005.html +0 -32
  108. data/junk/doc/old-api/classes/File.src/M000006.html +0 -32
  109. data/junk/doc/old-api/created.rid +0 -1
  110. data/junk/doc/old-api/files/README.html +0 -112
  111. data/junk/doc/old-api/files/RELEASE-NOTES.html +0 -233
  112. data/junk/doc/old-api/files/fsdb_txt.html +0 -888
  113. data/junk/doc/old-api/files/lib/fsdb/database_rb.html +0 -115
  114. data/junk/doc/old-api/files/lib/fsdb/file-lock_rb.html +0 -109
  115. data/junk/doc/old-api/files/lib/fsdb/modex_rb.html +0 -121
  116. data/junk/doc/old-api/files/lib/fsdb/mutex_rb.html +0 -108
  117. data/junk/doc/old-api/files/lib/fsdb/util_rb.html +0 -108
  118. data/junk/doc/old-api/fr_class_index.html +0 -47
  119. data/junk/doc/old-api/fr_file_index.html +0 -34
  120. data/junk/doc/old-api/fr_method_index.html +0 -90
  121. data/junk/doc/old-api/index.html +0 -24
  122. data/junk/doc/old-api/rdoc-style.css +0 -208
  123. data/junk/file-lock-nb.rb +0 -15
  124. data/junk/fl.rb +0 -144
  125. data/junk/flock-test.rb +0 -39
  126. data/junk/fsdb.kateproject +0 -47
  127. data/junk/fsdb.prj +0 -196
  128. data/junk/fsdb.sf +0 -46
  129. data/junk/insert-dir.rb +0 -48
  130. data/junk/lock-test-bug.rb +0 -150
  131. data/junk/lock-test-too-simple.rb +0 -136
  132. data/junk/lock-test.rb +0 -151
  133. data/junk/mkrdoc +0 -7
  134. data/junk/restore-fsdb.rb +0 -37
  135. data/junk/rf.txt +0 -5
  136. data/junk/solaris-bug-fixed.rb +0 -184
  137. data/junk/solaris-bug.rb +0 -182
  138. data/junk/solaris-bug.txt +0 -43
  139. data/junk/sync.rb +0 -327
  140. data/junk/test-file-lock.html +0 -86
  141. data/junk/test-file-lock.rb +0 -84
  142. data/junk/test-processes.rb +0 -131
  143. data/junk/test-threads.rb +0 -113
  144. data/junk/wiki-mutex.rb +0 -108
  145. data/misc/fsdb-blorubu.txt +0 -47
  146. data/misc/mtime-and-file-id.txt +0 -23
  147. data/misc/posixlock.txt +0 -148
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 35</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
15
- <span class="ruby-ivar">@waiting</span> = []
16
- <span class="ruby-ivar">@locked</span> = []
17
- <span class="ruby-ivar">@mode</span> = <span class="ruby-keyword kw">nil</span>
18
- <span class="ruby-ivar">@first</span> = <span class="ruby-keyword kw">true</span>
19
- <span class="ruby-keyword kw">end</span></pre>
20
- </body>
21
- </html>
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>try_lock (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 42</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">try_lock</span> <span class="ruby-identifier">mode</span>
15
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">exclusive</span> <span class="ruby-keyword kw">do</span>
16
- <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ThreadError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">thread</span>)
18
-
19
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@mode</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mode</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@waiting</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-comment cmt"># strict queue</span>
20
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
21
- <span class="ruby-keyword kw">true</span>
22
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@mode</span>
23
- <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">mode</span>
24
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
25
- <span class="ruby-keyword kw">true</span>
26
- <span class="ruby-keyword kw">end</span>
27
- <span class="ruby-keyword kw">end</span>
28
- <span class="ruby-keyword kw">end</span></pre>
29
- </body>
30
- </html>
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 35</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
15
- <span class="ruby-ivar">@waiting</span> = []
16
- <span class="ruby-ivar">@locked</span> = []
17
- <span class="ruby-ivar">@mode</span> = <span class="ruby-keyword kw">nil</span>
18
- <span class="ruby-ivar">@first</span> = <span class="ruby-keyword kw">true</span>
19
- <span class="ruby-keyword kw">end</span></pre>
20
- </body>
21
- </html>
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>try_lock (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 42</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">try_lock</span> <span class="ruby-identifier">mode</span>
15
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">exclusive</span> <span class="ruby-keyword kw">do</span>
16
- <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ThreadError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">thread</span>)
18
-
19
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@mode</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mode</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@waiting</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-comment cmt"># strict queue</span>
20
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
21
- <span class="ruby-keyword kw">true</span>
22
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@mode</span>
23
- <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">mode</span>
24
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
25
- <span class="ruby-keyword kw">true</span>
26
- <span class="ruby-keyword kw">end</span>
27
- <span class="ruby-keyword kw">end</span>
28
- <span class="ruby-keyword kw">end</span></pre>
29
- </body>
30
- </html>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>lock (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 59</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lock</span> <span class="ruby-identifier">mode</span>
15
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">exclusive</span> <span class="ruby-keyword kw">do</span>
16
- <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ThreadError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">thread</span>)
18
-
19
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@mode</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mode</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@waiting</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-comment cmt"># strict queue</span>
20
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
21
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@mode</span>
22
- <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">mode</span>
23
- <span class="ruby-ivar">@locked</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
24
- <span class="ruby-keyword kw">else</span>
25
- <span class="ruby-ivar">@waiting</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">mode</span>
26
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">stop</span>
27
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">critical</span> = <span class="ruby-keyword kw">true</span>
28
- <span class="ruby-keyword kw">end</span>
29
-
30
- <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
31
-
32
- <span class="ruby-comment cmt"># if @mode != mode</span>
33
- <span class="ruby-comment cmt"># raise &quot;@mode == #{@mode} but mode == #{mode}&quot;</span>
34
- <span class="ruby-comment cmt"># end</span>
35
- <span class="ruby-comment cmt">#</span>
36
- <span class="ruby-comment cmt"># if @mode == EX and @locked.size &gt; 1</span>
37
- <span class="ruby-comment cmt"># raise &quot;@mode == EX but @locked.size == #{@locked.size}&quot;</span>
38
- <span class="ruby-comment cmt"># end</span>
39
-
40
- <span class="ruby-keyword kw">self</span>
41
- <span class="ruby-keyword kw">end</span>
42
- <span class="ruby-keyword kw">end</span></pre>
43
- </body>
44
- </html>
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>unlock (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 90</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unlock</span>
15
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ThreadError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@mode</span>
16
-
17
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">exclusive</span> <span class="ruby-keyword kw">do</span>
18
- <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
19
- <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">delete</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
20
- <span class="ruby-identifier">wake_next_waiter</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">empty?</span>
21
- <span class="ruby-keyword kw">end</span>
22
-
23
- <span class="ruby-keyword kw">self</span>
24
- <span class="ruby-keyword kw">end</span></pre>
25
- </body>
26
- </html>
@@ -1,48 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>synchronize (FSDB::Modex)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/fsdb/modex.rb, line 102</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">synchronize</span> <span class="ruby-identifier">mode</span>, <span class="ruby-identifier">do_when_first</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">do_when_last</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg</span> = <span class="ruby-keyword kw">nil</span>
15
- <span class="ruby-identifier">lock</span> <span class="ruby-identifier">mode</span> <span class="ruby-keyword kw">do</span>
16
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@first</span>
17
- <span class="ruby-ivar">@first</span> = <span class="ruby-keyword kw">false</span>
18
-
19
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">do_when_first</span>
20
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SH</span>
21
- <span class="ruby-ivar">@mode</span> = <span class="ruby-constant">EX</span>
22
- <span class="ruby-keyword kw">end</span>
23
-
24
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">nonexclusive</span> { <span class="ruby-identifier">do_when_first</span>[<span class="ruby-identifier">arg</span>] }
25
-
26
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SH</span>
27
- <span class="ruby-ivar">@mode</span> = <span class="ruby-constant">SH</span>
28
- <span class="ruby-identifier">wake_waiting_sharers</span>
29
- <span class="ruby-keyword kw">end</span>
30
- <span class="ruby-keyword kw">end</span>
31
- <span class="ruby-keyword kw">end</span>
32
- <span class="ruby-keyword kw">end</span>
33
-
34
- <span class="ruby-keyword kw">yield</span>
35
-
36
- <span class="ruby-keyword kw">ensure</span>
37
- <span class="ruby-identifier">unlock</span> <span class="ruby-keyword kw">do</span>
38
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
39
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">do_when_last</span>
40
- <span class="ruby-ivar">@mode</span> = <span class="ruby-constant">EX</span>
41
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">nonexclusive</span> { <span class="ruby-identifier">do_when_last</span>[<span class="ruby-identifier">arg</span>] }
42
- <span class="ruby-keyword kw">end</span>
43
- <span class="ruby-ivar">@first</span> = <span class="ruby-keyword kw">true</span>
44
- <span class="ruby-keyword kw">end</span>
45
- <span class="ruby-keyword kw">end</span>
46
- <span class="ruby-keyword kw">end</span></pre>
47
- </body>
48
- </html>
@@ -1,105 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: FSDB::Modex::ForkSafely</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">FSDB::Modex::ForkSafely</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/fsdb/modex_rb.html">
59
- lib/fsdb/modex.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
-
76
-
77
- </div>
78
-
79
-
80
- </div>
81
-
82
-
83
- <!-- if includes -->
84
-
85
- <div id="section">
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
- <!-- if method_list -->
95
-
96
-
97
- </div>
98
-
99
-
100
- <div id="validator-badges">
101
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
102
- </div>
103
-
104
- </body>
105
- </html>
@@ -1,244 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: FSDB::Mutex</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">FSDB::Mutex</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/fsdb/mutex_rb.html">
59
- lib/fsdb/mutex.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- <a href="Mutex.html">Mutex</a> class based on standard thread.rb <a
84
- href="Mutex.html">Mutex</a>, which has some problems:
85
- </p>
86
- <ul>
87
- <li>waiters are not a strict queue (<a href="Mutex.html#M000022">try_lock</a>
88
- can jump the queue, after which the queue gets <b>rotated</b>). Race
89
- condition.
90
-
91
- </li>
92
- <li>doesn&#8217;t use Thread.exclusive in enough places
93
-
94
- </li>
95
- <li>no way to make dead threads give up the mutex, which is crucial in a fork
96
-
97
- </li>
98
- </ul>
99
- <p>
100
- Note: neither this <a href="Mutex.html">Mutex</a> nor the one in thread.rb
101
- is nestable.
102
- </p>
103
-
104
- </div>
105
-
106
-
107
- </div>
108
-
109
- <div id="method-list">
110
- <h3 class="section-bar">Methods</h3>
111
-
112
- <div class="name-list">
113
- <a href="#M000023">lock</a>&nbsp;&nbsp;
114
- <a href="#M000021">locked?</a>&nbsp;&nbsp;
115
- <a href="#M000020">new</a>&nbsp;&nbsp;
116
- <a href="#M000025">synchronize</a>&nbsp;&nbsp;
117
- <a href="#M000022">try_lock</a>&nbsp;&nbsp;
118
- <a href="#M000024">unlock</a>&nbsp;&nbsp;
119
- </div>
120
- </div>
121
-
122
- </div>
123
-
124
-
125
- <!-- if includes -->
126
-
127
- <div id="section">
128
-
129
- <div id="class-list">
130
- <h3 class="section-bar">Classes and Modules</h3>
131
-
132
- Module <a href="Mutex/ForkSafely.html" class="link">FSDB::Mutex::ForkSafely</a><br />
133
-
134
- </div>
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- <!-- if method_list -->
143
- <div id="methods">
144
- <h3 class="section-bar">Public Class methods</h3>
145
-
146
- <div id="method-M000020" class="method-detail">
147
- <a name="M000020"></a>
148
-
149
- <div class="method-heading">
150
- <a href="Mutex.src/M000020.html" target="Code" class="method-signature"
151
- onclick="popupCode('Mutex.src/M000020.html');return false;">
152
- <span class="method-name">new</span><span class="method-args">()</span>
153
- </a>
154
- </div>
155
-
156
- <div class="method-description">
157
- </div>
158
- </div>
159
-
160
- <h3 class="section-bar">Public Instance methods</h3>
161
-
162
- <div id="method-M000023" class="method-detail">
163
- <a name="M000023"></a>
164
-
165
- <div class="method-heading">
166
- <a href="Mutex.src/M000023.html" target="Code" class="method-signature"
167
- onclick="popupCode('Mutex.src/M000023.html');return false;">
168
- <span class="method-name">lock</span><span class="method-args">()</span>
169
- </a>
170
- </div>
171
-
172
- <div class="method-description">
173
- </div>
174
- </div>
175
-
176
- <div id="method-M000021" class="method-detail">
177
- <a name="M000021"></a>
178
-
179
- <div class="method-heading">
180
- <a href="Mutex.src/M000021.html" target="Code" class="method-signature"
181
- onclick="popupCode('Mutex.src/M000021.html');return false;">
182
- <span class="method-name">locked?</span><span class="method-args">()</span>
183
- </a>
184
- </div>
185
-
186
- <div class="method-description">
187
- </div>
188
- </div>
189
-
190
- <div id="method-M000025" class="method-detail">
191
- <a name="M000025"></a>
192
-
193
- <div class="method-heading">
194
- <a href="Mutex.src/M000025.html" target="Code" class="method-signature"
195
- onclick="popupCode('Mutex.src/M000025.html');return false;">
196
- <span class="method-name">synchronize</span><span class="method-args">() {|| ...}</span>
197
- </a>
198
- </div>
199
-
200
- <div class="method-description">
201
- </div>
202
- </div>
203
-
204
- <div id="method-M000022" class="method-detail">
205
- <a name="M000022"></a>
206
-
207
- <div class="method-heading">
208
- <a href="Mutex.src/M000022.html" target="Code" class="method-signature"
209
- onclick="popupCode('Mutex.src/M000022.html');return false;">
210
- <span class="method-name">try_lock</span><span class="method-args">()</span>
211
- </a>
212
- </div>
213
-
214
- <div class="method-description">
215
- </div>
216
- </div>
217
-
218
- <div id="method-M000024" class="method-detail">
219
- <a name="M000024"></a>
220
-
221
- <div class="method-heading">
222
- <a href="Mutex.src/M000024.html" target="Code" class="method-signature"
223
- onclick="popupCode('Mutex.src/M000024.html');return false;">
224
- <span class="method-name">unlock</span><span class="method-args">()</span>
225
- </a>
226
- </div>
227
-
228
- <div class="method-description">
229
- </div>
230
- </div>
231
-
232
-
233
- </div>
234
-
235
-
236
- </div>
237
-
238
-
239
- <div id="validator-badges">
240
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
241
- </div>
242
-
243
- </body>
244
- </html>