Skip to content

Commit 7457f3a

Browse files
Merge branch 'master' into master
2 parents 459b5e5 + e3921c2 commit 7457f3a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

basics/imports-and-modules.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ The D compiler would then try to load `my/cat/package.d` instead of `my/cat.d`.
4747
The convention (but not a hard rule) for `package.d` files is to publicly import
4848
all other modules in the same folder.
4949

50+
### In-Depth
51+
52+
- [Modules and Libraries in _Programming in D_](http://ddili.org/ders/d.en/modules.html)
53+
- [Modules specification](https://dlang.org/spec/module.html)
54+
5055
## {SourceCode}
5156

5257
```d

multithreading/synchronization-sharing.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ its own variable.
2424

2525
`synchronized` blocks are used to tell the compiler
2626
to create a critical section that can only be entered
27-
by one thread at a time.
27+
by one thread at a time. With no arguments, a unique mutex
28+
for that statement alone will be locked and unlocked.
2829

2930
synchronized {
3031
importStuff();
3132
}
3233

33-
Within `class` member functions these blocks might be
34-
limited to different member objects *mutexes*
35-
with `synchronized(member1, member2)` to reduce
36-
contention. The D compiler inserts *critical
34+
Synchronization can be limited to just a class object's
35+
*mutex* by passing the object as an argument using
36+
`synchronized (obj)` to reduce contention.
37+
38+
The D compiler inserts *critical
3739
sections* automatically. A whole class can be marked
3840
as `synchronized` as well in which case the compiler will
3941
make sure that just one thread accesses a concrete
@@ -53,7 +55,9 @@ helper:
5355
- [Lock-Based Synchronization with `synchronized`](http://www.informit.com/articles/article.aspx?p=1609144&seqNum=13)
5456
- [Deadlocks and `synchronized`](http://www.informit.com/articles/article.aspx?p=1609144&seqNum=15)
5557
- [`synchronized` specification](https://dlang.org/spec/statement.html#SynchronizedStatement)
56-
- [Implicit conversions with `shared` data types](https://dlang.org/spec/const3.html#implicit_conversions)
58+
- [`synchronized` classes](https://dlang.org/spec/class.html#synchronized-classes)
59+
- [`shared` type qualifier](https://dlang.org/spec/const3.html#shared)
60+
- [Implicit conversions with `shared` data types](https://dlang.org/spec/const3.html#implicit_qualifier_conversions)
5761

5862
## {SourceCode}
5963

0 commit comments

Comments
 (0)