Skip to content

Commit e2af4af

Browse files
author
paul.moran
committed
some fixes
1 parent 9fd5ce2 commit e2af4af

File tree

3 files changed

+8
-33
lines changed

3 files changed

+8
-33
lines changed

fluidsynth/src/platform_abstraction.cpp

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ extern "C"
5555

5656
void do_mutex_free(void* ptr)
5757
{
58-
58+
delete reinterpret_cast<std::mutex*>(ptr);
5959
}
6060

6161
void do_mutex_lock(void* ptr)
6262
{
63-
63+
reinterpret_cast<std::mutex*>(ptr)->lock();
6464
}
6565

6666
void do_mutex_unlock(void* ptr)
6767
{
68-
68+
reinterpret_cast<std::mutex*>(ptr)->unlock();
6969
}
7070

7171
// ==============================================
@@ -151,12 +151,6 @@ extern "C"
151151
return v;
152152
}
153153

154-
void* do_thread_self()
155-
{
156-
// return std::this_thread
157-
return 0;
158-
}
159-
160154
int flud_atomic_int_get(int* ptr)
161155
{
162156
return *ptr;
@@ -167,13 +161,9 @@ extern "C"
167161
* @param thread Thread to join
168162
* @return FLUID_OK
169163
*/
170-
int
171-
fluid_thread_join(void* thread)
164+
int fluid_thread_join(void* thread)
172165
{
173-
// TODO FIX ME
174-
175166
reinterpret_cast<std::thread*>(thread)->join();
176-
// g_thread_join (thread);
177167

178168
//return FLUID_OK;
179169
return 0;
@@ -190,7 +180,6 @@ extern "C"
190180
std::this_thread::sleep_for(std::chrono::milliseconds(v));
191181
}
192182

193-
194183
void fluid_get_current_time(struct fluid_time* ptr)
195184
{
196185
// TODO FIX ME
@@ -209,10 +198,7 @@ extern "C"
209198

210199
void* new_fluid_thread(const char *name, fluid_thread_func_t func, void *data, int prio_level, int detach)
211200
{
212-
// TODO FIX ME
213-
214201
std::thread* t = new std::thread(func, data);
215-
216202
if (detach)
217203
{
218204
t->detach();
@@ -276,13 +262,8 @@ extern "C"
276262
* Frees data associated with a thread (does not actually stop thread).
277263
* @param thread Thread to free
278264
*/
279-
void
280-
delete_fluid_thread(void* thread)
265+
void delete_fluid_thread(void* thread)
281266
{
282-
// TODO FIX ME
283-
284-
/* Threads free themselves when they quit, nothing to do */
285-
286267
delete reinterpret_cast<std::thread*>(thread);
287268
}
288269
}

fluidsynth/src/synth/fluid_synth.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,10 +2808,6 @@ fluid_synth_render_blocks(fluid_synth_t* synth, int blockcount)
28082808
{
28092809
int i;
28102810
fluid_profile_ref_var (prof_ref);
2811-
2812-
/* Assign ID of synthesis thread */
2813-
// synth->synth_thread_id = fluid_thread_get_id ();
2814-
28152811
fluid_check_fpe("??? Just starting up ???");
28162812

28172813
fluid_rvoice_eventhandler_dispatch_all(synth->eventhandler);

fluidsynth/src/utils/fluid_sys.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ int do_atomic_int_add(volatile int* i, volatile int v);
121121
int do_atomic_int_get(volatile void* ptr);
122122
void do_atomic_int_set(volatile void* ptr, volatile int v);
123123
int do_atomic_int_exchange_and_add(volatile void* ptr, int v);
124-
void* do_thread_self();
125124
int flud_atomic_int_get(int* ptr);
126125

127126
// TODO FIX ME
@@ -211,9 +210,9 @@ typedef void* fluid_mutex_t;
211210

212211
/* Recursive lock capable mutex */
213212
typedef void* fluid_rec_mutex_t;
214-
#define fluid_rec_mutex_destroy(_m) do_static_rec_mutex_free(&(_m))
215-
#define fluid_rec_mutex_lock(_m) do_static_rec_mutex_lock(&(_m))
216-
#define fluid_rec_mutex_unlock(_m) do_static_rec_mutex_unlock(&(_m))
213+
#define fluid_rec_mutex_destroy(_m) do_static_rec_mutex_free(_m)
214+
#define fluid_rec_mutex_lock(_m) do_static_rec_mutex_lock(_m)
215+
#define fluid_rec_mutex_unlock(_m) do_static_rec_mutex_unlock(_m)
217216

218217
#define fluid_rec_mutex_init(_m) G_STMT_START { \
219218
if (!do_thread_supported ()) do_thread_init (NULL); \
@@ -298,7 +297,6 @@ typedef void (*fluid_thread_func_t)(void* data);
298297

299298
#define FLUID_THREAD_ID_NULL NULL /* A NULL "ID" value */
300299
#define fluid_thread_id_t void * /* Data type for a thread ID */
301-
#define fluid_thread_get_id() do_thread_self() /* Get unique "ID" for current thread */
302300

303301
fluid_thread_t* new_fluid_thread(const char *name, fluid_thread_func_t func, void *data,
304302
int prio_level, int detach);

0 commit comments

Comments
 (0)