Skip to content
Snippets Groups Projects
Commit 801b662f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Remove blinker_lock

This lock has devolved into a wrapper lock for vstatlock.
parent 7309e270
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -100,7 +100,6 @@ pthread_mutex_t free_rect_lock; ...@@ -100,7 +100,6 @@ pthread_mutex_t free_rect_lock;
/* Exported globals */ /* Exported globals */
pthread_mutex_t vstatlock; pthread_mutex_t vstatlock;
pthread_mutex_t blinker_lock;
/* Forward declarations */ /* Forward declarations */
...@@ -714,7 +713,6 @@ static void blinker_thread(void *data) ...@@ -714,7 +713,6 @@ static void blinker_thread(void *data)
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
} }
/* Lock out ciolib while we handle shit */ /* Lock out ciolib while we handle shit */
pthread_mutex_lock(&blinker_lock);
if (check_redraw()) { if (check_redraw()) {
if (update_from_vmem(TRUE)) if (update_from_vmem(TRUE))
request_redraw(); request_redraw();
...@@ -750,7 +748,6 @@ static void blinker_thread(void *data) ...@@ -750,7 +748,6 @@ static void blinker_thread(void *data)
} }
} }
cb_flush(); cb_flush();
pthread_mutex_unlock(&blinker_lock);
} }
} }
...@@ -877,8 +874,6 @@ int bitmap_puttext(int sx, int sy, int ex, int ey, void *fill) ...@@ -877,8 +874,6 @@ int bitmap_puttext(int sx, int sy, int ex, int ey, void *fill)
uint16_t *buf = fill; uint16_t *buf = fill;
struct vstat_vmem *vmem_ptr; struct vstat_vmem *vmem_ptr;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
vmem_ptr = get_vmem(&vstat); vmem_ptr = get_vmem(&vstat);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
...@@ -891,7 +886,6 @@ int bitmap_puttext(int sx, int sy, int ex, int ey, void *fill) ...@@ -891,7 +886,6 @@ int bitmap_puttext(int sx, int sy, int ex, int ey, void *fill)
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
release_vmem(vmem_ptr); release_vmem(vmem_ptr);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return ret; return ret;
} }
...@@ -902,9 +896,7 @@ int bitmap_vmem_puttext(int sx, int sy, int ex, int ey, struct vmem_cell *fill) ...@@ -902,9 +896,7 @@ int bitmap_vmem_puttext(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
if(!bitmap_initialized) if(!bitmap_initialized)
return(0); return(0);
pthread_mutex_lock(&blinker_lock);
ret = bitmap_vmem_puttext_locked(sx, sy, ex, ey, fill); ret = bitmap_vmem_puttext_locked(sx, sy, ex, ey, fill);
pthread_mutex_unlock(&blinker_lock);
return ret; return ret;
} }
...@@ -929,7 +921,6 @@ int bitmap_vmem_gettext(int sx, int sy, int ex, int ey, struct vmem_cell *fill) ...@@ -929,7 +921,6 @@ int bitmap_vmem_gettext(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
return(0); return(0);
} }
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
vmem_ptr = get_vmem(&vstat); vmem_ptr = get_vmem(&vstat);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
...@@ -940,7 +931,6 @@ int bitmap_vmem_gettext(int sx, int sy, int ex, int ey, struct vmem_cell *fill) ...@@ -940,7 +931,6 @@ int bitmap_vmem_gettext(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
release_vmem(vmem_ptr); release_vmem(vmem_ptr);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return(1); return(1);
} }
...@@ -949,7 +939,6 @@ void bitmap_gotoxy(int x, int y) ...@@ -949,7 +939,6 @@ void bitmap_gotoxy(int x, int y)
if(!bitmap_initialized) if(!bitmap_initialized)
return; return;
/* Move cursor location */ /* Move cursor location */
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if (vstat.curs_col != x + cio_textinfo.winleft - 1 || vstat.curs_row != y + cio_textinfo.wintop - 1) { if (vstat.curs_col != x + cio_textinfo.winleft - 1 || vstat.curs_row != y + cio_textinfo.wintop - 1) {
cio_textinfo.curx=x; cio_textinfo.curx=x;
...@@ -960,14 +949,12 @@ void bitmap_gotoxy(int x, int y) ...@@ -960,14 +949,12 @@ void bitmap_gotoxy(int x, int y)
force_cursor = 1; force_cursor = 1;
} }
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
void bitmap_setcursortype(int type) void bitmap_setcursortype(int type)
{ {
if(!bitmap_initialized) if(!bitmap_initialized)
return; return;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
switch(type) { switch(type) {
case _NOCURSOR: case _NOCURSOR:
...@@ -986,7 +973,6 @@ void bitmap_setcursortype(int type) ...@@ -986,7 +973,6 @@ void bitmap_setcursortype(int type)
break; break;
} }
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
int bitmap_setfont(int font, int force, int font_num) int bitmap_setfont(int font, int force, int font_num)
...@@ -1014,7 +1000,6 @@ int bitmap_setfont(int font, int force, int font_num) ...@@ -1014,7 +1000,6 @@ int bitmap_setfont(int font, int force, int font_num)
else if(conio_fontdata[font].eight_by_eight!=NULL) else if(conio_fontdata[font].eight_by_eight!=NULL)
newmode=C80X50; newmode=C80X50;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
switch(vstat.charheight) { switch(vstat.charheight) {
case 8: case 8:
...@@ -1073,7 +1058,6 @@ int bitmap_setfont(int font, int force, int font_num) ...@@ -1073,7 +1058,6 @@ int bitmap_setfont(int font, int force, int font_num)
if(!new) { if(!new) {
free(old); free(old);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return 0; return 0;
} }
pold=old; pold=old;
...@@ -1120,12 +1104,10 @@ int bitmap_setfont(int font, int force, int font_num) ...@@ -1120,12 +1104,10 @@ int bitmap_setfont(int font, int force, int font_num)
} }
bitmap_loadfont_locked(NULL); bitmap_loadfont_locked(NULL);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return(1); return(1);
error_return: error_return:
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return(0); return(0);
} }
...@@ -1133,14 +1115,12 @@ int bitmap_getfont(int font_num) ...@@ -1133,14 +1115,12 @@ int bitmap_getfont(int font_num)
{ {
int ret; int ret;
pthread_mutex_lock(&blinker_lock);
if (font_num == 0) if (font_num == 0)
ret = default_font; ret = default_font;
else if (font_num > 4) else if (font_num > 4)
ret = -1; ret = -1;
else else
ret = current_font[font_num - 1]; ret = current_font[font_num - 1];
pthread_mutex_unlock(&blinker_lock);
return ret; return ret;
} }
...@@ -1149,11 +1129,9 @@ int bitmap_loadfont(const char *filename) ...@@ -1149,11 +1129,9 @@ int bitmap_loadfont(const char *filename)
{ {
int ret; int ret;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
ret = bitmap_loadfont_locked(filename); ret = bitmap_loadfont_locked(filename);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return ret; return ret;
} }
...@@ -1218,7 +1196,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy) ...@@ -1218,7 +1196,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy)
if(toy > y) if(toy > y)
direction=-1; direction=-1;
pthread_mutex_lock(&blinker_lock);
if (direction == -1) { if (direction == -1) {
sourcepos=(y+height-2)*cio_textinfo.screenwidth+(x-1); sourcepos=(y+height-2)*cio_textinfo.screenwidth+(x-1);
destoffset=(((toy+height-2)*cio_textinfo.screenwidth+(tox-1))-sourcepos); destoffset=(((toy+height-2)*cio_textinfo.screenwidth+(tox-1))-sourcepos);
...@@ -1248,7 +1225,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy) ...@@ -1248,7 +1225,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy)
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
release_vmem(vmem_ptr); release_vmem(vmem_ptr);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return(1); return(1);
} }
...@@ -1260,7 +1236,6 @@ void bitmap_clreol(void) ...@@ -1260,7 +1236,6 @@ void bitmap_clreol(void)
struct vstat_vmem *vmem_ptr; struct vstat_vmem *vmem_ptr;
int row; int row;
pthread_mutex_lock(&blinker_lock);
row = cio_textinfo.cury + cio_textinfo.wintop - 1; row = cio_textinfo.cury + cio_textinfo.wintop - 1;
pos=(row - 1)*cio_textinfo.screenwidth; pos=(row - 1)*cio_textinfo.screenwidth;
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
...@@ -1273,7 +1248,6 @@ void bitmap_clreol(void) ...@@ -1273,7 +1248,6 @@ void bitmap_clreol(void)
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
release_vmem(vmem_ptr); release_vmem(vmem_ptr);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
void bitmap_clrscr(void) void bitmap_clrscr(void)
...@@ -1283,7 +1257,6 @@ void bitmap_clrscr(void) ...@@ -1283,7 +1257,6 @@ void bitmap_clrscr(void)
struct vstat_vmem *vmem_ptr; struct vstat_vmem *vmem_ptr;
int rows, cols; int rows, cols;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
vmem_ptr = get_vmem(&vstat); vmem_ptr = get_vmem(&vstat);
rows = vstat.rows; rows = vstat.rows;
...@@ -1298,12 +1271,10 @@ void bitmap_clrscr(void) ...@@ -1298,12 +1271,10 @@ void bitmap_clrscr(void)
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
release_vmem(vmem_ptr); release_vmem(vmem_ptr);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
void bitmap_getcustomcursor(int *s, int *e, int *r, int *b, int *v) void bitmap_getcustomcursor(int *s, int *e, int *r, int *b, int *v)
{ {
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if(s) if(s)
*s=vstat.curs_start; *s=vstat.curs_start;
...@@ -1316,14 +1287,12 @@ void bitmap_getcustomcursor(int *s, int *e, int *r, int *b, int *v) ...@@ -1316,14 +1287,12 @@ void bitmap_getcustomcursor(int *s, int *e, int *r, int *b, int *v)
if(v) if(v)
*v=vstat.curs_visible; *v=vstat.curs_visible;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
void bitmap_setcustomcursor(int s, int e, int r, int b, int v) void bitmap_setcustomcursor(int s, int e, int r, int b, int v)
{ {
double ratio; double ratio;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if(r==0) if(r==0)
ratio=0; ratio=0;
...@@ -1339,14 +1308,12 @@ void bitmap_setcustomcursor(int s, int e, int r, int b, int v) ...@@ -1339,14 +1308,12 @@ void bitmap_setcustomcursor(int s, int e, int r, int b, int v)
vstat.curs_visible=v; vstat.curs_visible=v;
force_cursor = 1; force_cursor = 1;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
int bitmap_getvideoflags(void) int bitmap_getvideoflags(void)
{ {
int flags=0; int flags=0;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if(vstat.bright_background) if(vstat.bright_background)
flags |= CIOLIB_VIDEO_BGBRIGHT; flags |= CIOLIB_VIDEO_BGBRIGHT;
...@@ -1359,13 +1326,11 @@ int bitmap_getvideoflags(void) ...@@ -1359,13 +1326,11 @@ int bitmap_getvideoflags(void)
if(vstat.blink_altcharset) if(vstat.blink_altcharset)
flags |= CIOLIB_VIDEO_BLINKALTCHARS; flags |= CIOLIB_VIDEO_BLINKALTCHARS;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return(flags); return(flags);
} }
void bitmap_setvideoflags(int flags) void bitmap_setvideoflags(int flags)
{ {
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if(flags & CIOLIB_VIDEO_BGBRIGHT) if(flags & CIOLIB_VIDEO_BGBRIGHT)
vstat.bright_background=1; vstat.bright_background=1;
...@@ -1392,26 +1357,21 @@ void bitmap_setvideoflags(int flags) ...@@ -1392,26 +1357,21 @@ void bitmap_setvideoflags(int flags)
else else
vstat.blink_altcharset=0; vstat.blink_altcharset=0;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
} }
int bitmap_attr2palette(uint8_t attr, uint32_t *fgp, uint32_t *bgp) int bitmap_attr2palette(uint8_t attr, uint32_t *fgp, uint32_t *bgp)
{ {
int ret; int ret;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
ret = bitmap_attr2palette_locked(attr, fgp, bgp); ret = bitmap_attr2palette_locked(attr, fgp, bgp);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
return ret; return ret;
} }
int bitmap_setpixel(uint32_t x, uint32_t y, uint32_t colour) int bitmap_setpixel(uint32_t x, uint32_t y, uint32_t colour)
{ {
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&screena.screenlock); pthread_mutex_lock(&screena.screenlock);
if (x < screena.screenwidth && y < screena.screenheight) { if (x < screena.screenwidth && y < screena.screenheight) {
if (screena.rect->data[PIXEL_OFFSET(screena, x, y)] != colour) { if (screena.rect->data[PIXEL_OFFSET(screena, x, y)] != colour) {
...@@ -1430,8 +1390,6 @@ int bitmap_setpixel(uint32_t x, uint32_t y, uint32_t colour) ...@@ -1430,8 +1390,6 @@ int bitmap_setpixel(uint32_t x, uint32_t y, uint32_t colour)
} }
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&blinker_lock);
return 1; return 1;
} }
...@@ -1466,13 +1424,11 @@ int bitmap_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_ ...@@ -1466,13 +1424,11 @@ int bitmap_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_
return 0; return 0;
} }
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&screena.screenlock); pthread_mutex_lock(&screena.screenlock);
pthread_mutex_lock(&screenb.screenlock); pthread_mutex_lock(&screenb.screenlock);
if (ex > screena.screenwidth || ey > screena.screenheight) { if (ex > screena.screenwidth || ey > screena.screenheight) {
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
return 0; return 0;
} }
...@@ -1530,7 +1486,6 @@ int bitmap_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_ ...@@ -1530,7 +1486,6 @@ int bitmap_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_
} }
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
return 1; return 1;
} }
...@@ -1568,7 +1523,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui ...@@ -1568,7 +1523,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui
return NULL; return NULL;
} }
pthread_mutex_lock(&blinker_lock);
update_from_vmem(force); update_from_vmem(force);
pthread_mutex_lock(&screena.screenlock); pthread_mutex_lock(&screena.screenlock);
pthread_mutex_lock(&screenb.screenlock); pthread_mutex_lock(&screenb.screenlock);
...@@ -1576,7 +1530,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui ...@@ -1576,7 +1530,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui
ex >= screenb.screenwidth || ey >= screenb.screenheight) { ex >= screenb.screenwidth || ey >= screenb.screenheight) {
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
free(pixels->pixelsb); free(pixels->pixelsb);
free(pixels->pixels); free(pixels->pixels);
free(pixels); free(pixels);
...@@ -1590,7 +1543,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui ...@@ -1590,7 +1543,6 @@ struct ciolib_pixels *bitmap_getpixels(uint32_t sx, uint32_t sy, uint32_t ex, ui
} }
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
return pixels; return pixels;
} }
...@@ -1618,12 +1570,9 @@ uint32_t bitmap_map_rgb(uint16_t r, uint16_t g, uint16_t b) ...@@ -1618,12 +1570,9 @@ uint32_t bitmap_map_rgb(uint16_t r, uint16_t g, uint16_t b)
void bitmap_replace_font(uint8_t id, char *name, void *data, size_t size) void bitmap_replace_font(uint8_t id, char *name, void *data, size_t size)
{ {
pthread_mutex_lock(&blinker_lock);
if (id < CONIO_FIRST_FREE_FONT) { if (id < CONIO_FIRST_FREE_FONT) {
free(name); free(name);
free(data); free(data);
pthread_mutex_unlock(&blinker_lock);
return; return;
} }
...@@ -1655,7 +1604,6 @@ void bitmap_replace_font(uint8_t id, char *name, void *data, size_t size) ...@@ -1655,7 +1604,6 @@ void bitmap_replace_font(uint8_t id, char *name, void *data, size_t size)
request_redraw(); request_redraw();
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
} }
int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b) int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b)
...@@ -1663,7 +1611,6 @@ int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b) ...@@ -1663,7 +1611,6 @@ int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b)
if (index > 65535) if (index > 65535)
return 0; return 0;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&screena.screenlock); pthread_mutex_lock(&screena.screenlock);
pthread_mutex_lock(&screenb.screenlock); pthread_mutex_lock(&screenb.screenlock);
palette[index] = (0xff << 24) | ((r>>8) << 16) | ((g>>8) << 8) | (b>>8); palette[index] = (0xff << 24) | ((r>>8) << 16) | ((g>>8) << 8) | (b>>8);
...@@ -1671,7 +1618,6 @@ int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b) ...@@ -1671,7 +1618,6 @@ int bitmap_setpalette(uint32_t index, uint16_t r, uint16_t g, uint16_t b)
screenb.update_pixels = 1; screenb.update_pixels = 1;
pthread_mutex_unlock(&screenb.screenlock); pthread_mutex_unlock(&screenb.screenlock);
pthread_mutex_unlock(&screena.screenlock); pthread_mutex_unlock(&screena.screenlock);
pthread_mutex_unlock(&blinker_lock);
return 1; return 1;
} }
...@@ -1721,8 +1667,6 @@ int bitmap_drv_init_mode(int mode, int *width, int *height) ...@@ -1721,8 +1667,6 @@ int bitmap_drv_init_mode(int mode, int *width, int *height)
return(-1); return(-1);
if(load_vmode(&vstat, mode)) { if(load_vmode(&vstat, mode)) {
// TODO: WTF?
//pthread_mutex_unlock(&blinker_lock);
return(-1); return(-1);
} }
...@@ -1785,7 +1729,6 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data) ...@@ -1785,7 +1729,6 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data)
| CONIO_OPT_SET_PIXEL | CONIO_OPT_CUSTOM_CURSOR | CONIO_OPT_SET_PIXEL | CONIO_OPT_CUSTOM_CURSOR
| CONIO_OPT_FONT_SELECT | CONIO_OPT_EXTENDED_PALETTE | CONIO_OPT_PALETTE_SETTING | CONIO_OPT_FONT_SELECT | CONIO_OPT_EXTENDED_PALETTE | CONIO_OPT_PALETTE_SETTING
| CONIO_OPT_BLOCKY_SCALING; | CONIO_OPT_BLOCKY_SCALING;
pthread_mutex_init(&blinker_lock, NULL);
pthread_mutex_init(&callbacks.lock, NULL); pthread_mutex_init(&callbacks.lock, NULL);
pthread_mutex_init(&vstatlock, NULL); pthread_mutex_init(&vstatlock, NULL);
pthread_mutex_init(&screena.screenlock, NULL); pthread_mutex_init(&screena.screenlock, NULL);
......
...@@ -19,7 +19,6 @@ struct rectlist { ...@@ -19,7 +19,6 @@ struct rectlist {
extern struct video_stats vstat; extern struct video_stats vstat;
extern pthread_mutex_t vstatlock; extern pthread_mutex_t vstatlock;
extern pthread_mutex_t blinker_lock;
#ifndef BITMAP_CIOLIB_DRIVER #ifndef BITMAP_CIOLIB_DRIVER
/* Called from ciolib */ /* Called from ciolib */
......
...@@ -380,7 +380,6 @@ static int sdl_init_mode(int mode) ...@@ -380,7 +380,6 @@ static int sdl_init_mode(int mode)
sdl_user_func(SDL_USEREVENT_FLUSH); sdl_user_func(SDL_USEREVENT_FLUSH);
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
oldcols = vstat.cols; oldcols = vstat.cols;
bitmap_drv_init_mode(mode, &bitmap_width, &bitmap_height); bitmap_drv_init_mode(mode, &bitmap_width, &bitmap_height);
...@@ -419,7 +418,6 @@ static int sdl_init_mode(int mode) ...@@ -419,7 +418,6 @@ static int sdl_init_mode(int mode)
sdl_mode = true; sdl_mode = true;
pthread_mutex_unlock(&sdl_mode_mutex); pthread_mutex_unlock(&sdl_mode_mutex);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
sdl_user_func_ret(SDL_USEREVENT_SETVIDMODE, vstat.winwidth, vstat.winheight); sdl_user_func_ret(SDL_USEREVENT_SETVIDMODE, vstat.winwidth, vstat.winheight);
......
...@@ -412,7 +412,6 @@ static void init_mode_internal(int mode) ...@@ -412,7 +412,6 @@ static void init_mode_internal(int mode)
oldcols=x_cvstat.cols; oldcols=x_cvstat.cols;
pthread_mutex_lock(&blinker_lock);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if (last) { if (last) {
release_buffer(last); release_buffer(last);
...@@ -432,7 +431,6 @@ static void init_mode_internal(int mode) ...@@ -432,7 +431,6 @@ static void init_mode_internal(int mode)
x_cvstat = vstat; x_cvstat = vstat;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
pthread_mutex_unlock(&blinker_lock);
map_window(); map_window();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment