1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

rename scm_async_click() to scm_async_tick(); privatize SCM_ASYNC_TICK

* libguile/_scm.h (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE): Make these
  definitions private.  Call the tick() function instead of click().

* libguile/__scm.h:
* libguile/async.h (scm_async_tick): Move declaration here.  Remove
  scm_async_click declaration.  Tick is the new (and old!) click, you
  see.
  (SCM_CRITICAL_SECTION_END): Call tick() instead of click().

* libguile/async.c (scm_async_tick): Remove old definition, and rename
  scm_async_click to scm_async_tick.
  (decrease_block): Adapt to click() -> tick() name change.

* libguile/deprecated.h (scm_async_click, SCM_ASYNC_TICK): Define some
  GONE macros.

* libguile/threads.c (fat_mutex_unlock): Tick() instead of click().
This commit is contained in:
Andy Wingo 2011-05-15 13:11:03 +02:00
parent f311754e17
commit 27c6ebcb16
6 changed files with 32 additions and 43 deletions

View file

@ -390,38 +390,6 @@ typedef long SCM_STACKITEM;
#define SCM_STACK_PTR(ptr) ((SCM_STACKITEM *) (void *) (ptr))
SCM_API void scm_async_tick (void);
#ifdef BUILDING_LIBGUILE
/* FIXME: should change names */
# define SCM_ASYNC_TICK \
do \
{ \
if (SCM_UNLIKELY (SCM_I_CURRENT_THREAD->pending_asyncs)) \
scm_async_click (); \
} \
while (0)
/* SCM_ASYNC_TICK_WITH_CODE is only available to Guile itself */
# define SCM_ASYNC_TICK_WITH_CODE(thr, stmt) \
do \
{ \
if (SCM_UNLIKELY (thr->pending_asyncs)) \
{ \
stmt; \
scm_async_click (); \
} \
} \
while (0)
#else /* !BUILDING_LIBGUILE */
# define SCM_ASYNC_TICK (scm_async_tick ())
#endif /* !BUILDING_LIBGUILE */
/* Anthony Green writes:
When the compiler sees...
DEFER_INTS;

View file

@ -225,6 +225,27 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
#define SCM_ASYNC_TICK \
do \
{ \
if (SCM_UNLIKELY (SCM_I_CURRENT_THREAD->pending_asyncs)) \
scm_async_tick (); \
} \
while (0)
#define SCM_ASYNC_TICK_WITH_CODE(thr, stmt) \
do \
{ \
if (SCM_UNLIKELY (thr->pending_asyncs)) \
{ \
stmt; \
scm_async_tick (); \
} \
} \
while (0)
/* The endianness marker in objcode. */
#ifdef WORDS_BIGENDIAN

View file

@ -137,7 +137,7 @@ static scm_i_pthread_mutex_t async_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER;
/* System asyncs. */
void
scm_async_click ()
scm_async_tick (void)
{
scm_i_thread *t = SCM_I_CURRENT_THREAD;
SCM asyncs;
@ -334,7 +334,7 @@ decrease_block (void *data)
{
scm_i_thread *t = data;
if (--t->block_asyncs == 0)
scm_async_click ();
scm_async_tick ();
}
void
@ -444,12 +444,6 @@ scm_critical_section_end (void)
SCM_CRITICAL_SECTION_END;
}
void
scm_async_tick (void)
{
SCM_ASYNC_TICK;
}
void

View file

@ -29,7 +29,7 @@
SCM_API void scm_async_click (void);
SCM_API void scm_async_tick (void);
SCM_API void scm_switch (void);
SCM_API SCM scm_async (SCM thunk);
SCM_API SCM scm_async_mark (SCM a);
@ -75,7 +75,7 @@ SCM_API void scm_critical_section_end (void);
SCM_I_CURRENT_THREAD->critical_section_level--; \
SCM_I_CURRENT_THREAD->block_asyncs--; \
scm_i_pthread_mutex_unlock (&scm_i_critical_section_mutex); \
scm_async_click (); \
scm_async_tick (); \
} while (0)
#else /* !BUILDING_LIBGUILE */

View file

@ -72,6 +72,7 @@ SCM_DEPRECATED SCM scm_internal_dynamic_wind (scm_t_guard before,
#define SCM_VALIDATE_SUBSTRING_SPEC_COPY SCM_VALIDATE_SUBSTRING_SPEC_COPY__GONE
#define scm_array scm_array__GONE__REPLACE_WITH__scm_t_array
#define scm_array_dim scm_array_dim__GONE__REPLACE_WITH__scm_t_array_dim
#define scm_async_click scm_async_click__GONE__REPLACE_WITH__scm_async_tick
#define scm_fport scm_fport__GONE__REPLACE_WITH__scm_t_fport
#define scm_listify scm_listify__GONE__REPLACE_WITH__scm_list_n
#define scm_option scm_option__GONE__REPLACE_WITH__scm_t_option
@ -92,6 +93,11 @@ SCM_DEPRECATED SCM scm_internal_dynamic_wind (scm_t_guard before,
#define scm_vtable_index_vtable scm_vtable_index_vtable__GONE__REPLACE_WITH__scm_vtable_index_self
typedef scm_i_t_array scm_i_t_array__GONE__REPLACE_WITH__scm_t_array;
#ifndef BUILDING_LIBGUILE
#define SCM_ASYNC_TICK SCM_ASYNC_TICK__GONE__REPLACE_WITH__scm_async_tick
#endif
void scm_i_init_deprecated (void);

View file

@ -1575,7 +1575,7 @@ fat_mutex_unlock (SCM mutex, SCM cond,
}
t->block_asyncs--;
scm_async_click ();
scm_async_tick ();
scm_remember_upto_here_2 (cond, mutex);