Fixed the SLiRP and SCSI mutexes.
This commit is contained in:
@@ -36,13 +36,6 @@ static void *slirpMutex;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
network_slirp_mutex_init(void)
|
|
||||||
{
|
|
||||||
slirpMutex = thread_create_mutex(L"86Box.SLiRPMutex");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
startslirp(void)
|
startslirp(void)
|
||||||
{
|
{
|
||||||
@@ -176,6 +169,8 @@ network_slirp_setup(uint8_t *mac, NETRXCB func, void *arg)
|
|||||||
poll_rx = func;
|
poll_rx = func;
|
||||||
poll_arg = arg;
|
poll_arg = arg;
|
||||||
|
|
||||||
|
slirpMutex = thread_create_mutex(L"86Box.SLiRPMutex");
|
||||||
|
|
||||||
poll_data.wake_poll_thread = thread_create_event();
|
poll_data.wake_poll_thread = thread_create_event();
|
||||||
poll_data.poll_complete = thread_create_event();
|
poll_data.poll_complete = thread_create_event();
|
||||||
|
|
||||||
@@ -208,6 +203,8 @@ network_slirp_close(void)
|
|||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
thread_close_mutex(slirpMutex);
|
||||||
|
|
||||||
/* OK, now shut down SLiRP itself. */
|
/* OK, now shut down SLiRP itself. */
|
||||||
QueueDestroy(sl);
|
QueueDestroy(sl);
|
||||||
slirp_exit(0);
|
slirp_exit(0);
|
||||||
|
@@ -89,8 +89,6 @@ network_init(void)
|
|||||||
|
|
||||||
if (network_type != NET_TYPE_PCAP)
|
if (network_type != NET_TYPE_PCAP)
|
||||||
network_pcap_close();
|
network_pcap_close();
|
||||||
|
|
||||||
network_slirp_mutex_init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
src/pc.c
1
src/pc.c
@@ -294,7 +294,6 @@ usage:
|
|||||||
hdd_init();
|
hdd_init();
|
||||||
network_init();
|
network_init();
|
||||||
cdrom_global_init();
|
cdrom_global_init();
|
||||||
scsi_mutex_init();
|
|
||||||
|
|
||||||
/* Load the configuration file. */
|
/* Load the configuration file. */
|
||||||
config_load(cfg);
|
config_load(cfg);
|
||||||
|
@@ -130,6 +130,12 @@ void scsi_mutex_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void scsi_mutex_close(void)
|
||||||
|
{
|
||||||
|
thread_close_mutex(scsiMutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void scsi_card_init(void)
|
void scsi_card_init(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@@ -294,6 +294,7 @@ extern int scsi_card_has_config(int card);
|
|||||||
extern char *scsi_card_get_internal_name(int card);
|
extern char *scsi_card_get_internal_name(int card);
|
||||||
extern int scsi_card_get_from_internal_name(char *s);
|
extern int scsi_card_get_from_internal_name(char *s);
|
||||||
extern void scsi_mutex_init(void);
|
extern void scsi_mutex_init(void);
|
||||||
|
extern void scsi_mutex_close(void);
|
||||||
extern void scsi_card_init(void);
|
extern void scsi_card_init(void);
|
||||||
extern void scsi_card_reset(void);
|
extern void scsi_card_reset(void);
|
||||||
|
|
||||||
|
@@ -1861,6 +1861,8 @@ x54x_init(device_t *info)
|
|||||||
|
|
||||||
timer_add(x54x_reset_poll, &dev->ResetCB, &dev->ResetCB, dev);
|
timer_add(x54x_reset_poll, &dev->ResetCB, &dev->ResetCB, dev);
|
||||||
|
|
||||||
|
scsi_mutex_init();
|
||||||
|
|
||||||
poll_complete = thread_create_event();
|
poll_complete = thread_create_event();
|
||||||
|
|
||||||
/* Create a waitable event. */
|
/* Create a waitable event. */
|
||||||
@@ -1899,6 +1901,8 @@ x54x_close(void *priv)
|
|||||||
evt = NULL;
|
evt = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scsi_mutex_close();
|
||||||
|
|
||||||
if (dev->nvr != NULL)
|
if (dev->nvr != NULL)
|
||||||
free(dev->nvr);
|
free(dev->nvr);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user