Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/book.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3433,7 +3433,7 @@ \section{Creating threads}
int i;
pthread_t child[NUM_CHILDREN];

Shared *shared = make_shared(1000000);
Shared *shared = make_shared();

for (i=0; i<NUM_CHILDREN; i++) {
child[i] = make_thread(entry, shared);
Expand Down Expand Up @@ -3601,7 +3601,7 @@ \section{Synchronization errors}
And initialize it in \verb"make_shared"

\begin{verbatim}
Shared *make_shared(int end)
Shared *make_shared()
{
Shared *shared = check_malloc(sizeof(Shared));
shared->counter = 0;
Expand Down
4 changes: 2 additions & 2 deletions code/counter/counter_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct {
Mutex *mutex;
} Shared;

Shared *make_shared(int end)
Shared *make_shared()
{
Shared *shared = check_malloc(sizeof(Shared));
shared->counter = 0;
Expand Down Expand Up @@ -80,7 +80,7 @@ int main()
int i;
pthread_t child[NUM_CHILDREN];

Shared *shared = make_shared(1000000);
Shared *shared = make_shared();

for (i=0; i<NUM_CHILDREN; i++) {
child[i] = make_thread(entry, shared);
Expand Down