Locking ideas for 1.3

i know i’ve brought up some locking stuff before, and it sounds
like there will be some good changes in the distant SDL 1.3.
anyways, i have a simple-ish request that will really help me
out.

it would make my life world’s easier if i could nest my
SDL_LockSurface/SDL_UnlockSurface calls. many of my library
functions need direct pixel access and need a locked surface.
currently i need to be very careful about checking "where"
the surface was really locked and making sure it is only
unlocked at that same level.

anyways. it does not seem hard to add a crude lock-counting
mechanism and only do the “real” unlocking after all the
SDL_UnlockSurface calls have been made. of course, there’s
a few special cases in the SDL code, so i might be mistaken.

are there any reasons that make this a bad idea?

i know i’ve brought up some locking stuff before, and it sounds
like there will be some good changes in the distant SDL 1.3.
anyways, i have a simple-ish request that will really help me
out.

it would make my life world’s easier if i could nest my
SDL_LockSurface/SDL_UnlockSurface calls. many of my library
functions need direct pixel access and need a locked surface.
currently i need to be very careful about checking "where"
the surface was really locked and making sure it is only
unlocked at that same level.

You got it. It’s in the latest CVS snapshot, and does not break binary
compatibility. :slight_smile:

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

“Sam Lantinga” wrote

i know i’ve brought up some locking stuff before, and it sounds
like there will be some good changes in the distant SDL 1.3.
anyways, i have a simple-ish request that will really help me
out.

it would make my life world’s easier if i could nest my
SDL_LockSurface/SDL_UnlockSurface calls. many of my library
functions need direct pixel access and need a locked surface.
currently i need to be very careful about checking "where"
the surface was really locked and making sure it is only
unlocked at that same level.

You got it. It’s in the latest CVS snapshot, and does not break binary
compatibility. :slight_smile:

wow, great! here i wasn’t expecting anything like this for
several months. (instead it shows up in several hours)

wow, great! here i wasn’t expecting anything like this for
several months. (instead it shows up in several hours)

:slight_smile:

Can you test it please?

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software