Skip to content

Commit

Permalink
* YAM_UT.c: changed the DisplayStatistics() function to be thread saf…
Browse files Browse the repository at this point in the history
…e. It could happen that a POP3 mail transfer was initiated while the Incoming folder was not the currently active folder and hence its index was flushed from memory before. The POP3 download would then trigger an index reload for the Incoming folder which in turn would update the global folder statistics. That would eventually happen from a different thread than the main thread and produce a warning requester with recent MUI version. The thread safety now closes #484.
  • Loading branch information
tboeckel committed Dec 29, 2013
1 parent 279bcf7 commit ef17493
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 24 deletions.
19 changes: 15 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,30 @@ YAM Open Source - ChangeLog
$Id$
$URL$

2013-12-29 Thore B�ckelmann <tboeckel@gmx.de>

* YAM_UT.c: changed the DisplayStatistics() function to be thread safe. It
could happen that a POP3 mail transfer was initiated while the Incoming
folder was not the currently active folder and hence its index was flushed
from memory before. The POP3 download would then trigger an index reload for
the Incoming folder which in turn would update the global folder statistics.
That would eventually happen from a different thread than the main thread
and produce a warning requester with recent MUI version. The thread safety
now closes #484.

2013-12-27 Jens Maus <mail@jens-maus.de>

* locale/cd2po.sh: added a first version of a shell script which allows
to convert our catalog description (.cd) and translation (.ct) related
files to gettext (.pot/.po) files so that we can in future switch to
the web-based services of transifex.com. Back-conversion routines are
still missing, thought.
files to gettext (.pot/.po) files so that we can in future switch to
the web-based services of transifex.com. Back-conversion routines are
still missing, thought.
* locale: fixed a bunch of catalog translation related problems where
the catalog description syntax/layout was not always maintained.
* mui/SignatureTextEdit.c: modified the signature text editor to not
parse the signature text via the ParseEmailText() function as otherwise
the text styles end up in mixing up the signature. This closes #489.
* mui/AddressBookConfigPage.c, mui/FiltersConfigPage.c,
* mui/AddressBookConfigPage.c, mui/FiltersConfigPage.c,
mui/IdentitiesConfigPage.c, mui/ScriptsConfigPage.c: fixed a minor
cosmetic bug where the wrong config page titles were displayed.
This closes #488.
Expand Down
2 changes: 1 addition & 1 deletion src/Busy.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void BusyEnd(struct BusyNode *busy)
else
{
// called from a thread, push a method on the stack
PushMethodOnStackWait(G->App, 2, MUIM_YAMApplication_BusyEnd, busy);
PushMethodOnStack(G->App, 2, MUIM_YAMApplication_BusyEnd, busy);
}
}

Expand Down
46 changes: 27 additions & 19 deletions src/YAM_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4962,29 +4962,37 @@ void DisplayStatistics(struct Folder *fo, BOOL updateAppIcon)
{
ENTER();

// If the parsed argument is NULL we want to show the statistics from the actual folder
if(fo == NULL)
fo = GetCurrentFolder();
else if(fo == (struct Folder *)-1)
fo = FO_GetFolderByType(FT_INCOMING, NULL);

if(fo != NULL)
if(IsMainThread() == TRUE)
{
D(DBF_GUI, "updating statistics for folder '%s', appicon %ld", fo->Name, updateAppIcon);

// update the folder image
if(isGroupFolder(fo) == FALSE)
FO_SetFolderImage(fo);
// recalc the number of messages of the folder group
FO_UpdateTreeStatistics(fo, TRUE);
// If the parsed argument is NULL we want to show the statistics from the actual folder
if(fo == NULL)
fo = GetCurrentFolder();
else if(fo == (struct Folder *)-1)
fo = FO_GetFolderByType(FT_INCOMING, NULL);

if(fo == GetCurrentFolder())
if(fo != NULL)
{
DoMethod(G->MA->GUI.IB_INFOBAR, MUIM_InfoBar_SetFolder, fo);
}
D(DBF_GUI, "updating statistics for folder '%s', appicon %ld", fo->Name, updateAppIcon);

if(G->AppIconQuiet == FALSE && updateAppIcon == TRUE)
UpdateAppIcon();
// update the folder image
if(isGroupFolder(fo) == FALSE)
FO_SetFolderImage(fo);
// recalc the number of messages of the folder group
FO_UpdateTreeStatistics(fo, TRUE);

if(fo == GetCurrentFolder())
{
DoMethod(G->MA->GUI.IB_INFOBAR, MUIM_InfoBar_SetFolder, fo);
}

if(G->AppIconQuiet == FALSE && updateAppIcon == TRUE)
UpdateAppIcon();
}
}
else
{
// called from a thread, push a method on the stack
PushMethodOnStack(G->App, 3, MUIM_YAMApplication_DisplayStatistics, fo, updateAppIcon);
}

LEAVE();
Expand Down

0 comments on commit ef17493

Please sign in to comment.