I overlooked spin locks when I added the mutex and the read and write lock status codes.
F_lock_not,
F_lock_read,
F_lock_read_not,
+ F_lock_spin,
+ F_lock_spin_not,
F_lock_write,
F_lock_write_not,
F_loop,
const f_string_static_t f_status_lock_not_s = macro_f_string_static_t_initialize_1(F_status_lock_not_s, 0, F_status_lock_not_s_length);
const f_string_static_t f_status_lock_read_s = macro_f_string_static_t_initialize_1(F_status_lock_read_s, 0, F_status_lock_read_s_length);
const f_string_static_t f_status_lock_read_not_s = macro_f_string_static_t_initialize_1(F_status_lock_read_not_s, 0, F_status_lock_read_not_s_length);
+ const f_string_static_t f_status_lock_spin_s = macro_f_string_static_t_initialize_1(F_status_lock_spin_s, 0, F_status_lock_spin_s_length);
+ const f_string_static_t f_status_lock_spin_not_s = macro_f_string_static_t_initialize_1(F_status_lock_spin_not_s, 0, F_status_lock_spin_not_s_length);
const f_string_static_t f_status_lock_write_s = macro_f_string_static_t_initialize_1(F_status_lock_write_s, 0, F_status_lock_write_s_length);
const f_string_static_t f_status_lock_write_not_s = macro_f_string_static_t_initialize_1(F_status_lock_write_not_s, 0, F_status_lock_write_not_s_length);
const f_string_static_t f_status_loop_s = macro_f_string_static_t_initialize_1(F_status_loop_s, 0, F_status_loop_s_length);
break;
+ case F_lock_spin:
+ *name = f_status_lock_spin_s;
+
+ break;
+
+ case F_lock_spin_not:
+ *name = f_status_lock_spin_not_s;
+
+ break;
+
case F_lock_write:
*name = f_status_lock_write_s;
#define F_status_lock_not_s "F_lock_not"
#define F_status_lock_read_s "F_lock_read"
#define F_status_lock_read_not_s "F_lock_read_not"
+ #define F_status_lock_spin_s "F_lock_spin"
+ #define F_status_lock_spin_not_s "F_lock_spin_not"
#define F_status_lock_write_s "F_lock_write"
#define F_status_lock_write_not_s "F_lock_write_not"
#define F_status_loop_s "F_loop"
#define F_status_lock_not_s_length 10
#define F_status_lock_read_s_length 11
#define F_status_lock_read_not_s_length 15
+ #define F_status_lock_spin_s_length 11
+ #define F_status_lock_spin_not_s_length 15
#define F_status_lock_write_s_length 12
#define F_status_lock_write_not_s_length 16
#define F_status_loop_s_length 6
extern const f_string_static_t f_status_lock_not_s;
extern const f_string_static_t f_status_lock_read_s;
extern const f_string_static_t f_status_lock_read_not_s;
+ extern const f_string_static_t f_status_lock_spin_s;
+ extern const f_string_static_t f_status_lock_spin_not_s;
extern const f_string_static_t f_status_lock_write_s;
extern const f_string_static_t f_status_lock_write_not_s;
extern const f_string_static_t f_status_loop_s;
F_lock_not,
F_lock_read,
F_lock_read_not,
+ F_lock_spin,
+ F_lock_spin_not,
F_lock_write,
F_lock_write_not,
F_loop,
f_status_lock_not_s,
f_status_lock_read_s,
f_status_lock_read_not_s,
+ f_status_lock_spin_s,
+ f_status_lock_spin_not_s,
f_status_lock_write_s,
f_status_lock_write_not_s,
f_status_loop_s,
f_status_status_code_last_s,
};
- for (uint16_t i = 0; i < 644; ++i) {
+ for (uint16_t i = 0; i < 646; ++i) {
f_string_static_t result = f_string_static_t_initialize;
const int error = pthread_mutex_unlock(mutex);
if (error) {
- if (error == EAGAIN) return F_status_set_error(F_resource_not);
- if (error == EBUSY) return F_status_set_error(F_busy);
if (error == EINVAL) return F_status_set_error(F_parameter);
if (error == EPERM) return F_status_set_error(F_prohibited);
*
* F_parameter (with error bit) if a parameter is invalid.
* F_prohibited (with error bit) if not allowed to perform the operation (possibly because mutex is not owned by current thread).
- * F_resource_not (with error bit) if max mutex locks is reached.
*
* F_failure (with error bit) on any other error.
*
return F_okay;
}
+ if (f_compare_dynamic(name, f_status_lock_spin_s) == F_equal_to) {
+ *code = F_lock_spin;
+
+ return F_okay;
+ }
+
+ if (f_compare_dynamic(name, f_status_lock_spin_not_s) == F_equal_to) {
+ *code = F_lock_spin_not;
+
+ return F_okay;
+ }
+
if (f_compare_dynamic(name, f_status_lock_write_s) == F_equal_to) {
*code = F_lock_write;
F_lock_not,
F_lock_read,
F_lock_read_not,
+ F_lock_spin,
+ F_lock_spin_not,
F_lock_write,
F_lock_write_not,
F_loop,
f_status_lock_not_s,
f_status_lock_read_s,
f_status_lock_read_not_s,
+ f_status_lock_spin_s,
+ f_status_lock_spin_not_s,
f_status_lock_write_s,
f_status_lock_write_not_s,
f_status_loop_s,