1 --- cvs-fast-export-1.62/atom.c.orig 2023-12-10 21:33:28.557717340 +0100
2 +++ cvs-fast-export-1.62/atom.c 2023-12-10 21:33:33.707747222 +0100
3 @@ -99,21 +99,22 @@ atom(const char *string)
7 - while ((b = *head)) {
9 - if (b->hash == hash && !strcmp(string, b->string))
15 pthread_mutex_lock(&bucket_mutex);
18 + while ((b = *head)) {
20 + if (b->hash == hash && !strcmp(string, b->string)) {
23 pthread_mutex_unlock(&bucket_mutex);
33 @@ -154,21 +155,22 @@ atom_cvs_number(const cvs_number n)
34 number_bucket_t **head = &number_buckets[bucket];
37 - while ((b = *head)) {
39 - if (cvs_number_equal(&b->number, &n))
45 pthread_mutex_lock(&number_bucket_mutex);
48 + while ((b = *head)) {
50 + if (cvs_number_equal(&b->number, &n)) {
53 pthread_mutex_unlock(&number_bucket_mutex);
63 --- cvs-fast-export-1.62/revcvs.c.orig 2023-05-13 19:35:07.000000000 +0200
64 +++ cvs-fast-export-1.62/revcvs.c 2023-12-10 21:41:28.540502302 +0100
68 const master_dir *root_dir = NULL;
70 +static pthread_mutex_t root_dir_mutex = PTHREAD_MUTEX_INITIALIZER;
74 fileop_name(const char *rectified)
75 @@ -86,21 +89,22 @@ atom_dir(const char* dirname)
76 dir_bucket **head = &dir_buckets[HASH_VALUE(dirname) % DIR_BUCKETS];
79 - while ((b = *head)) {
81 - if (b->dir.name == dirname)
87 pthread_mutex_lock(&dir_bucket_mutex);
90 + while ((b = *head)) {
92 + if (b->dir.name == dirname) {
95 pthread_mutex_unlock(&dir_bucket_mutex);
104 b = xmalloc(sizeof(dir_bucket), __func__);
105 @@ -800,7 +803,15 @@ cvs_master_digest(cvs_file *cvs, cvs_mas
107 cvs_version *ctrunk = NULL;
111 + pthread_mutex_lock(&root_dir_mutex);
113 if (!root_dir) root_dir = atom_dir(atom("\0"));
116 + pthread_mutex_unlock(&root_dir_mutex);
118 build_rev_master(cvs, master);
120 char buf[CVS_MAX_REV_LEN];