@@ -58,14 +58,14 @@ int Lock_create(struct agmdb_lock *new_lock, const char* lock_name, int lock_nam
58
58
return AGMDB_SUCCESS_LOCK_OPEN;
59
59
}
60
60
#else
61
- read_lock_name_len = (strlen (READ_LOCK_PREFIX ) + strlen (lock_name) + 1 ) * sizeof (char );
62
- write_lock_name_len = (strlen (WRITE_LOCK_PREFIX ) + strlen (lock_name) + 1 ) * sizeof (char );
61
+ read_lock_name_len = (strlen (READ_LOCK_SUFFIX ) + strlen (lock_name) + 1 ) * sizeof (char );
62
+ write_lock_name_len = (strlen (WRITE_LOCK_SUFFIX ) + strlen (lock_name) + 1 ) * sizeof (char );
63
63
64
64
if (AGMDB_isstring (lock_name, lock_name_length) != AGMDB_SUCCESS)
65
65
return AGMDB_ERROR_LOCK_WIN_NAME_INVALID_STRING;
66
66
67
67
read_lock_name = (char *)malloc (read_lock_name_len * sizeof (char ));
68
- sprintf_s (read_lock_name, read_lock_name_len, " %s%s" , READ_LOCK_PREFIX, lock_name );
68
+ sprintf_s (read_lock_name, read_lock_name_len, " %s%s" , lock_name, READ_LOCK_SUFFIX );
69
69
new_lock->read_lock_handle = CreateMutex (
70
70
NULL , // Default security settings.
71
71
FALSE , // Do not take the lock after created.
@@ -81,7 +81,7 @@ int Lock_create(struct agmdb_lock *new_lock, const char* lock_name, int lock_nam
81
81
lock_exists = true ;
82
82
83
83
write_lock_name = (char *)malloc (write_lock_name_len * sizeof (char ));
84
- sprintf_s (write_lock_name, write_lock_name_len, " %s%s" , WRITE_LOCK_PREFIX, lock_name );
84
+ sprintf_s (write_lock_name, write_lock_name_len, " %s%s" , lock_name, WRITE_LOCK_SUFFIX );
85
85
new_lock->write_lock_handle = CreateMutex (
86
86
NULL , // Default security settings.
87
87
FALSE , // Do not take the lock after created.
0 commit comments