FIND YOUR NEXT FEW LINES

Results for “shared”

Small, practical examples. Search by task or narrow things down below.

48 snippets foundClear filters
GitTags & repository configuration

Ignore a personal scratch file without changing shared rules

Git: The repository-local exclude file applies only to this checkout.

Git✓ Tested
C#Asynchronous work & URI handling

Increment a shared counter atomically

C#: Interlocked performs an indivisible update without a separate lock for this operation.

C#✓ Tested
C++Tasks & synchronization

Increment a shared counter safely

C++: Atomic increments prevent lost updates when two threads change the same counter.

C++✓ Tested
RustThreads & shared ownership

Initialize shared data once

Initialize shared data once in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsSorting & joining records

Join two sorted files by a shared key

Linux Commands: Use join for sorted, simple delimiter-separated records with one row per key.

Linux Commands✓ Tested
C++Ownership & optional values

Observe shared ownership without extending its lifetime

C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.

C++✓ Tested
C++Tasks & synchronization

Protect a shared container with a mutex

C++: A scoped lock_guard releases the mutex when its scope ends.

C++✓ Tested
GoConcurrency & cancellation

Protect a shared counter

Protect a shared counter using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Protect shared mutable state with a mutex

Protect shared mutable state with a mutex in a complete Rust program using the standard library.

Rust✓ Tested
JavaRecords & reliable control flow

Update a shared counter atomically

Java: AtomicInteger provides an indivisible increment operation for a shared counter.

Java✓ Tested
ReactContext & shared state

Update state shared through context

Update state shared through context with a small React component and explicit browser behavior.

React✓ Tested
C++Tasks & synchronization

Wait for shared state with a condition variable

C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.

C++✓ Tested