Make CPU and memory thread-safe
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
#include "vriscv.h"
|
||||
|
||||
uint8_t* memory;
|
||||
pthread_mutex_t memory_mutex;
|
||||
|
||||
void mem_init()
|
||||
{
|
||||
memory = malloc(memory_size);
|
||||
pthread_mutex_init(&memory_mutex, 0);
|
||||
}
|
||||
|
@@ -2,8 +2,10 @@
|
||||
#define MEMORY_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
extern uint8_t* memory;
|
||||
extern pthread_mutex_t memory_mutex;
|
||||
|
||||
void mem_init();
|
||||
|
||||
|
Reference in New Issue
Block a user