diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-29 21:23:56 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-29 21:23:56 -0700 |
commit | 8bafc90dfda6cd170343ad1d7351d418f38189ae (patch) | |
tree | 97c8fe5b5ebe9b7b40ca063dba4e3c9d6231e924 /html/088file.mu.html | |
parent | ef69c56c82e85e83014605f501110697d81bcdc1 (diff) | |
download | mu-8bafc90dfda6cd170343ad1d7351d418f38189ae.tar.gz |
3609
Diffstat (limited to 'html/088file.mu.html')
-rw-r--r-- | html/088file.mu.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/html/088file.mu.html b/html/088file.mu.html index 26fa0c7c..46d9363a 100644 --- a/html/088file.mu.html +++ b/html/088file.mu.html @@ -35,6 +35,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># are thus easier to test.</span> <span class="muData">container</span> resources [ + lock:bool data:&:@:resource ] @@ -117,7 +118,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">{</span> <span class="muControl">break-unless</span> resources <span class="Comment"># fake file system</span> - <span class="Comment"># beware: doesn't support multiple concurrent writes yet</span> routine-id <span class="Special"><-</span> start-running transmit-to-fake-file resources, filename, source <span class="muControl">reply</span> <span class="Delimiter">}</span> @@ -142,6 +142,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muRecipe">def</span> transmit-to-fake-file resources:&:resources, filename:text, source:&:source:char<span class="muRecipe"> -> </span>resources:&:resources, source:&:source:char [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> + lock:location <span class="Special"><-</span> get-location *resources, <span class="Constant">lock:offset</span> + wait-for-reset-then-set lock <span class="Comment"># compute new file contents</span> buf:&:buffer <span class="Special"><-</span> new-buffer<span class="Constant"> 30</span> <span class="Delimiter">{</span> @@ -166,6 +168,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color found?:bool <span class="Special"><-</span> equal filename, curr-filename <span class="muControl">loop-unless</span> found? put-index *data, i, new-resource + reset lock <span class="muControl">reply</span> <span class="Delimiter">}</span> <span class="Comment"># if file didn't already exist, make room for it</span> @@ -182,6 +185,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">}</span> <span class="Comment"># write new file</span> put-index *new-data, len, new-resource + reset lock ] </pre> </body> |