mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
[This commit was previously reverted because it seemed to cause the build to fail on Cygwin. But I just re-tested it, and it's fine. It may be that my Cygwin installation at the time was defective.] Something similar was previously done in07cc71b8
from a Debian patch, and eventually reverted; it redefined the ast atomic functions asoincint() and asodecint() to be gcc-specific. This imports the upstream version from the ksh 93v- beta instead. This commit is based on an OpenSUSE patch: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-joblock.dif src/cmd/ksh93/include/jobs.h: - Replace job locking mechanism with the 93v- version which uses the atomic libast functions asoincint(), asogetint() and asodecint(). See: src/lib/libast/man/aso.3 src/cmd/ksh93/sh/jobs.c: job_subsave(): - Revert gcc optimiser bug workaround fromc258a04f
. It should now be unnecessary.
This commit is contained in:
parent
b07d7b2097
commit
9c69fac793
4 changed files with 11 additions and 16 deletions
|
@ -377,6 +377,9 @@ make install
|
||||||
make include/jobs.h implicit
|
make include/jobs.h implicit
|
||||||
prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
|
prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
|
||||||
prev include/terminal.h implicit
|
prev include/terminal.h implicit
|
||||||
|
make ${PACKAGE_ast_INCLUDE}/aso.h implicit
|
||||||
|
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
|
||||||
|
done ${PACKAGE_ast_INCLUDE}/aso.h implicit
|
||||||
prev FEATURE/options implicit
|
prev FEATURE/options implicit
|
||||||
prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit
|
prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit
|
||||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
#endif /* !SIGINT */
|
#endif /* !SIGINT */
|
||||||
#include "FEATURE/options"
|
#include "FEATURE/options"
|
||||||
|
#include <aso.h>
|
||||||
|
|
||||||
#undef JOBS
|
#undef JOBS
|
||||||
#if defined(SIGCLD) && !defined(SIGCHLD)
|
#if defined(SIGCLD) && !defined(SIGCHLD)
|
||||||
|
@ -120,16 +121,13 @@ extern struct jobs job;
|
||||||
#define vmbusy() 0
|
#define vmbusy() 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define job_lock() (job.in_critical++)
|
#define job_lock() asoincint(&job.in_critical)
|
||||||
#define job_unlock() \
|
#define job_unlock() \
|
||||||
do { \
|
do { \
|
||||||
int sig; \
|
int _sig; \
|
||||||
if (!--job.in_critical && (sig = job.savesig)) \
|
if (asogetint(&job.in_critical) == 1 && (_sig = job.savesig) && !vmbusy()) \
|
||||||
{ \
|
job_reap(_sig); \
|
||||||
if (!job.in_critical++ && !vmbusy()) \
|
asodecint(&job.in_critical); \
|
||||||
job_reap(sig); \
|
|
||||||
job.in_critical--; \
|
|
||||||
} \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
extern const char e_jobusage[];
|
extern const char e_jobusage[];
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <releaseflags.h>
|
#include <releaseflags.h>
|
||||||
|
|
||||||
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
|
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
|
||||||
#define SH_RELEASE_SVER "1.0.0-rc.5" /* semantic version number: https://semver.org */
|
#define SH_RELEASE_SVER "1.0.0-rc.6" /* semantic version number: https://semver.org */
|
||||||
#define SH_RELEASE_DATE "2022-07-31" /* must be in this format for $((.sh.version)) */
|
#define SH_RELEASE_DATE "2022-07-31" /* must be in this format for $((.sh.version)) */
|
||||||
#define SH_RELEASE_CPYR "(c) 2020-2022 Contributors to ksh " SH_RELEASE_FORK
|
#define SH_RELEASE_CPYR "(c) 2020-2022 Contributors to ksh " SH_RELEASE_FORK
|
||||||
|
|
||||||
|
|
|
@ -1878,14 +1878,8 @@ again:
|
||||||
|
|
||||||
void *job_subsave(void)
|
void *job_subsave(void)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* We must make a lock first before doing anything else,
|
|
||||||
* otherwise GCC will remove the job locking mechanism
|
|
||||||
* as a result of compiler optimization.
|
|
||||||
*/
|
|
||||||
job_lock();
|
|
||||||
|
|
||||||
struct back_save *bp = new_of(struct back_save,0);
|
struct back_save *bp = new_of(struct back_save,0);
|
||||||
|
job_lock();
|
||||||
*bp = bck;
|
*bp = bck;
|
||||||
bp->prev = bck.prev;
|
bp->prev = bck.prev;
|
||||||
bck.count = 0;
|
bck.count = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue