From 7eecd22fb9e14e90e54dc795cc77738776bed200 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 25 Jul 2024 20:05:41 +0000 Subject: [PATCH] deploy: 6a9557e66e8f8be4fe6341ea3aede4406d35ebde --- atomics.html | 6 +++--- barrier.html | 6 +++--- channels.html | 6 +++--- dochack.js | 2 +- index.html | 6 +++--- once.html | 48 +++++++++++++++++++++++++++++------------------- once.idx | 12 ++++++------ rwlock.html | 6 +++--- semaphore.html | 6 +++--- smartptrs.html | 6 +++--- theindex.html | 6 +++--- waitgroups.html | 6 +++--- 12 files changed, 63 insertions(+), 53 deletions(-) diff --git a/atomics.html b/atomics.html index 1ab7516..5a8ea00 100644 --- a/atomics.html +++ b/atomics.html @@ -16,10 +16,10 @@ - + - +
@@ -501,7 +501,7 @@

Procs

diff --git a/barrier.html b/barrier.html index b7d9aa8..bdb62ec 100644 --- a/barrier.html +++ b/barrier.html @@ -16,10 +16,10 @@ - + - +
@@ -219,7 +219,7 @@

Procs

diff --git a/channels.html b/channels.html index 25811a5..15e3224 100644 --- a/channels.html +++ b/channels.html @@ -16,10 +16,10 @@ - + - +
@@ -415,7 +415,7 @@

Templates

diff --git a/dochack.js b/dochack.js index e7af120..70a447a 100644 --- a/dochack.js +++ b/dochack.js @@ -1,4 +1,4 @@ -/* Generated by the Nim Compiler v2.1.1 */ +/* Generated by the Nim Compiler v2.1.9 */ var framePtr = null; var excHandler = 0; var lastJSError = null; diff --git a/index.html b/index.html index 925d081..a975f8b 100644 --- a/index.html +++ b/index.html @@ -16,10 +16,10 @@ - + - +
@@ -364,7 +364,7 @@

Index

diff --git a/once.html b/once.html index ef088d7..abfafd7 100644 --- a/once.html +++ b/once.html @@ -16,10 +16,10 @@ - + - +
@@ -117,24 +117,34 @@

threading/once

var counter = 1 instance: ptr Singleton + exceptionOccurred = false o = createOnce() proc getInstance(): ptr Singleton = once(o): + if not exceptionOccurred: + # Simulate an exception on the first call + exceptionOccurred = true + raise newException(ValueError, "Simulated error") instance = createSharedU(Singleton) instance.data = counter inc counter result = instance proc worker {.thread.} = - for i in 1..1000: - assert getInstance().data == 1 + try: + for i in 1..1000: + let inst = getInstance() + assert inst.data == 1 + except ValueError: + echo "Caught expected ValueError" var threads: array[10, Thread[void]] for i in 0..<10: createThread(threads[i], worker) joinThreads(threads) -deallocShared(instance)

+deallocShared(instance) +echo "All threads completed"

Types

@@ -142,9 +152,9 @@

Types

Once = object
- Once is a type that allows you to execute a block of code exactly once. The first call to once will execute the block of code and all other calls will be ignored. - Source   -Edit   + Once is a type that allows you to execute a block of code exactly once. The first call to once will execute the block of code and all other calls will be ignored. All concurrent calls to once are guaranteed to observe any side-effects made by the active call, with no additional synchronization. + Source   +Edit  
@@ -160,8 +170,8 @@

Procs

- Source   -Edit   + Source   +Edit  
@@ -173,8 +183,8 @@

Procs

- Source   -Edit   + Source   +Edit  
@@ -186,8 +196,8 @@

Procs

- Source   -Edit   + Source   +Edit  
@@ -199,8 +209,8 @@

Procs

- Source   -Edit   + Source   +Edit  
@@ -218,8 +228,8 @@

Templates

Executes body exactly once. - Source   -Edit   + Source   +Edit  
@@ -235,7 +245,7 @@

Templates

diff --git a/once.idx b/once.idx index 70e69c8..e2366ba 100644 --- a/once.idx +++ b/once.idx @@ -1,7 +1,7 @@ nimTitle once once.html module threading/once 0 -nim Once once.html#Once object Once 43 -nim `=destroy` once.html#=destroy,Once proc `=destroy`(o: Once) 51 -nim `=sink` once.html#=sink,Once,Once proc `=sink`(dest: var Once; source: Once) 58 -nim `=copy` once.html#=copy,Once,Once proc `=copy`(dest: var Once; source: Once) 59 -nim createOnce once.html#createOnce proc createOnce(): Once 61 -nim once once.html#once.t,Once,untyped template once(o: Once; body: untyped) 65 +nim Once once.html#Once object Once 52 +nim `=destroy` once.html#=destroy,Once proc `=destroy`(o: Once) 68 +nim `=sink` once.html#=sink,Once,Once proc `=sink`(dest: var Once; source: Once) 77 +nim `=copy` once.html#=copy,Once,Once proc `=copy`(dest: var Once; source: Once) 78 +nim createOnce once.html#createOnce proc createOnce(): Once 80 +nim once once.html#once.t,Once,untyped template once(o: Once; body: untyped) 85 diff --git a/rwlock.html b/rwlock.html index 322c24c..f36059c 100644 --- a/rwlock.html +++ b/rwlock.html @@ -16,10 +16,10 @@ - + - +
@@ -315,7 +315,7 @@

Templates

diff --git a/semaphore.html b/semaphore.html index f052139..bf598f4 100644 --- a/semaphore.html +++ b/semaphore.html @@ -16,10 +16,10 @@ - + - +
@@ -232,7 +232,7 @@

Procs

diff --git a/smartptrs.html b/smartptrs.html index b7120ab..acce583 100644 --- a/smartptrs.html +++ b/smartptrs.html @@ -16,10 +16,10 @@ - + - +
@@ -545,7 +545,7 @@

Templates

diff --git a/theindex.html b/theindex.html index 925d081..a975f8b 100644 --- a/theindex.html +++ b/theindex.html @@ -16,10 +16,10 @@ - + - +
@@ -364,7 +364,7 @@

Index

diff --git a/waitgroups.html b/waitgroups.html index ac6e3e2..52e245f 100644 --- a/waitgroups.html +++ b/waitgroups.html @@ -16,10 +16,10 @@ - + - +
@@ -197,7 +197,7 @@

Procs