From 8bafc90dfda6cd170343ad1d7351d418f38189ae Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 29 Oct 2016 21:23:56 -0700 Subject: 3609 --- html/088file.mu.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'html/088file.mu.html') 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 # are thus easier to test. container resources [ + lock:bool data:&:@:resource ] @@ -117,7 +118,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color { break-unless resources # fake file system - # beware: doesn't support multiple concurrent writes yet routine-id <- start-running transmit-to-fake-file resources, filename, source reply } @@ -142,6 +142,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color def transmit-to-fake-file resources:&:resources, filename:text, source:&:source:char -> resources:&:resources, source:&:source:char [ local-scope load-ingredients + lock:location <- get-location *resources, lock:offset + wait-for-reset-then-set lock # compute new file contents buf:&:buffer <- new-buffer 30 { @@ -166,6 +168,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color found?:bool <- equal filename, curr-filename loop-unless found? put-index *data, i, new-resource + reset lock reply } # if file didn't already exist, make room for it @@ -182,6 +185,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color } # write new file put-index *new-data, len, new-resource + reset lock ] -- cgit 1.4.1-2-gfad0