1 --- cvs-fast-export-1.66/atom.c.orig 2024-04-07 15:44:05.728144147 +0200
2 +++ cvs-fast-export-1.66/atom.c 2024-04-07 15:49:33.189703469 +0200
3 @@ -100,24 +100,24 @@ const char *atom(const char *string)
9 + pthread_mutex_lock(&bucket_mutex);
14 if (b->hash == hash && !strcmp(string, b->string)) {
17 + pthread_mutex_unlock(&bucket_mutex);
26 - pthread_mutex_lock(&bucket_mutex);
32 - pthread_mutex_unlock(&bucket_mutex);
38 @@ -157,24 +157,24 @@ const cvs_number *atom_cvs_number(const
39 number_bucket_t **head = &number_buckets[bucket];
44 + pthread_mutex_lock(&number_bucket_mutex);
49 if (cvs_number_equal(&b->number, &n)) {
52 + pthread_mutex_unlock(&number_bucket_mutex);
61 - pthread_mutex_lock(&number_bucket_mutex);
67 - pthread_mutex_unlock(&number_bucket_mutex);
73 --- cvs-fast-export-1.66/revcvs.c.orig 2024-04-07 15:44:05.731477463 +0200
74 +++ cvs-fast-export-1.66/revcvs.c 2024-04-07 15:56:06.944236984 +0200
78 const master_dir *root_dir = NULL;
80 +static pthread_mutex_t root_dir_mutex = PTHREAD_MUTEX_INITIALIZER;
83 static const char *fileop_name(const char *rectified) {
84 size_t rlen = strlen(rectified);
85 @@ -79,24 +82,24 @@ static const master_dir *atom_dir(const
86 dir_bucket **head = &dir_buckets[HASH_VALUE(dirname) % DIR_BUCKETS];
91 + pthread_mutex_lock(&dir_bucket_mutex);
96 if (b->dir.name == dirname) {
99 + pthread_mutex_unlock(&dir_bucket_mutex);
101 +#endif /* THREADS */
108 - pthread_mutex_lock(&dir_bucket_mutex);
110 -#endif /* THREADS */
114 - pthread_mutex_unlock(&dir_bucket_mutex);
116 -#endif /* THREADS */
119 b = xmalloc(sizeof(dir_bucket), __func__);
120 @@ -859,9 +862,17 @@ cvs_commit *cvs_master_digest(cvs_file *
122 cvs_version *ctrunk = NULL;
126 + pthread_mutex_lock(&root_dir_mutex);
129 root_dir = atom_dir(atom("\0"));
133 + pthread_mutex_unlock(&root_dir_mutex);
135 build_rev_master(cvs, master);
137 char buf[CVS_MAX_REV_LEN];