[AD] [ alleg-Bugs-1890478 ] pack_fopen and file_size_ex not thread safe

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #1890478, was opened at 2008-02-10 02:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1890478&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: 4.2.0rc2
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Etienne Vouga (evouga)
Assigned to: Nobody/Anonymous (nobody)
Summary: pack_fopen and file_size_ex not thread safe

Initial Comment:
pack_fopen() and file_size_ex() are not thread-safe, because they refer to a global password set by packfile_password(). This limitation makes using packfiles in multi-threaded applications painful. To get around the problem, I've patched Allegro 4.2.2's file.h, file.c, and aintern.h to include the following new methods:

pack_fopen_password()
file_size_ex_password()

which work just like the regular versions of these functions, but take in an explicit const char *password to use instead of the global password. Passing in NULL means to default to the global password (not thread-safe, obviously.)

I would love to see functionality similar to this patch integrated into Allegro, as the packfile password is the only reason Allegro packfile IO is not thread-safe.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1890478&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/