1
10
13
14
20
21
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
99
100
101
102
103
108
109
110
111
112
113
114
115
116
117
122
123
124
125
126
127
128
133
134
135
136
137
138
...
...
...
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_thread.h"
#include "txm_module.h"
...
...
UINT _txm_module_manager_object_deallocate(VOID *object_ptr)
{
TXM_MODULE_INSTANCE *module_instance;
TXM_MODULE_ALLOCATED_OBJECT *module_allocated_object_ptr;
UINT return_value;
_txe_mutex_get(&_txm_module_manager_mutex, TX_WAIT_FOREVER);
if (_txm_module_manager_object_pool_created)
{
TXM_MODULE_ALLOCATED_OBJECT *next_object, *previous_object;
module_instance = _tx_thread_current_ptr -> tx_thread_module_instance_ptr;
module_allocated_object_ptr = (TXM_MODULE_ALLOCATED_OBJECT *) object_ptr;
previous_object = module_allocated_object_ptr--;
if ((module_allocated_object_ptr == TX_NULL) || (module_allocated_object_ptr -> txm_module_allocated_object_module_instance != module_instance) || (module_instance -> txm_module_instance_object_list_count == 0))
{
return_value = TX_PTR_ERROR;
}if ((module_allocated_object_ptr == TX_NULL) || (module_allocated_object_ptr -> txm_module_allocated_object_module_instance != module_instance) || (module_instance -> txm_module_instance_object_list_count == 0)) { ... }
else
{
if ((--module_instance -> txm_module_instance_object_list_count) == 0)
{
module_instance -> txm_module_instance_object_list_head = TX_NULL;
}if ((--module_instance -> txm_module_instance_object_list_count) == 0) { ... }
else
{
next_object = module_allocated_object_ptr -> txm_module_allocated_object_next;
previous_object = module_allocated_object_ptr -> txm_module_allocated_object_previous;
next_object -> txm_module_allocated_object_previous = previous_object;
previous_object -> txm_module_allocated_object_next = next_object;
if (module_instance -> txm_module_instance_object_list_head == module_allocated_object_ptr)
{
module_instance -> txm_module_instance_object_list_head = next_object;
}if (module_instance -> txm_module_instance_object_list_head == module_allocated_object_ptr) { ... }
}else { ... }
return_value = (ULONG) _txe_byte_release((VOID *) module_allocated_object_ptr);
}else { ... }
}if (_txm_module_manager_object_pool_created) { ... }
else
{
return_value = TX_NOT_AVAILABLE;
}else { ... }
_txe_mutex_put(&_txm_module_manager_mutex);
return(return_value);
}{ ... }