Fixed the SLiRP and SCSI mutexes.

This commit is contained in:
OBattler
2017-10-14 08:34:47 +02:00
parent 61626117b4
commit 1d3aa976ec
6 changed files with 15 additions and 10 deletions

View File

@@ -36,13 +36,6 @@ static void *slirpMutex;
void
network_slirp_mutex_init(void)
{
slirpMutex = thread_create_mutex(L"86Box.SLiRPMutex");
}
static void
startslirp(void)
{
@@ -176,6 +169,8 @@ network_slirp_setup(uint8_t *mac, NETRXCB func, void *arg)
poll_rx = func;
poll_arg = arg;
slirpMutex = thread_create_mutex(L"86Box.SLiRPMutex");
poll_data.wake_poll_thread = thread_create_event();
poll_data.poll_complete = thread_create_event();
@@ -208,6 +203,8 @@ network_slirp_close(void)
;
#endif
thread_close_mutex(slirpMutex);
/* OK, now shut down SLiRP itself. */
QueueDestroy(sl);
slirp_exit(0);

View File

@@ -89,8 +89,6 @@ network_init(void)
if (network_type != NET_TYPE_PCAP)
network_pcap_close();
network_slirp_mutex_init();
}

View File

@@ -294,7 +294,6 @@ usage:
hdd_init();
network_init();
cdrom_global_init();
scsi_mutex_init();
/* Load the configuration file. */
config_load(cfg);

View File

@@ -130,6 +130,12 @@ void scsi_mutex_init(void)
}
void scsi_mutex_close(void)
{
thread_close_mutex(scsiMutex);
}
void scsi_card_init(void)
{
int i, j;

View File

@@ -294,6 +294,7 @@ extern int scsi_card_has_config(int card);
extern char *scsi_card_get_internal_name(int card);
extern int scsi_card_get_from_internal_name(char *s);
extern void scsi_mutex_init(void);
extern void scsi_mutex_close(void);
extern void scsi_card_init(void);
extern void scsi_card_reset(void);

View File

@@ -1861,6 +1861,8 @@ x54x_init(device_t *info)
timer_add(x54x_reset_poll, &dev->ResetCB, &dev->ResetCB, dev);
scsi_mutex_init();
poll_complete = thread_create_event();
/* Create a waitable event. */
@@ -1899,6 +1901,8 @@ x54x_close(void *priv)
evt = NULL;
}
scsi_mutex_close();
if (dev->nvr != NULL)
free(dev->nvr);