Commit c2eb32c9 authored by Steve Lhomme's avatar Steve Lhomme

rename mwait() to vlc_tick_wait()

The lua "mwait" remains the same.
parent a6149e2c
......@@ -61,7 +61,7 @@ struct msghdr;
VLC_API int vlc_sem_wait_i11e(vlc_sem_t *);
/**
* Interruptible variant of mwait().
* Interruptible variant of vlc_tick_wait().
*
* Waits for a specified timestamp or, if the calling thread has an
* interruption context, an interruption.
......
......@@ -521,7 +521,7 @@ VLC_API void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex);
*
* This works like vlc_cond_wait() but with an additional time-out.
* The time-out is expressed as an absolute timestamp using the same arbitrary
* time reference as the mdate() and mwait() functions.
* time reference as the mdate() and vlc_tick_wait() functions.
*
* \note This function is a cancellation point. In case of thread cancellation,
* the mutex is always locked before cancellation proceeds.
......@@ -832,7 +832,7 @@ VLC_API unsigned long vlc_thread_id(void) VLC_USED;
* Precision monotonic clock.
*
* In principles, the clock has a precision of 1 MHz. But the actual resolution
* may be much lower, especially when it comes to sleeping with mwait() or
* may be much lower, especially when it comes to sleeping with vlc_tick_wait() or
* msleep(). Most general-purpose operating systems provide a resolution of
* only 100 to 1000 Hz.
*
......@@ -852,7 +852,7 @@ VLC_API vlc_tick_t mdate(void);
* \note The deadline may be exceeded due to OS scheduling.
* \note This function is a cancellation point.
*/
VLC_API void mwait(vlc_tick_t deadline);
VLC_API void vlc_tick_wait(vlc_tick_t deadline);
/**
* Waits for an interval of time.
......@@ -918,7 +918,7 @@ vlc_tick_t impossible_deadline( vlc_tick_t deadline )
#endif
#define msleep(d) msleep(check_delay(d))
#define mwait(d) mwait(check_deadline(d))
#define vlc_tick_wait(d) vlc_tick_wait(check_deadline(d))
/**
* Initializes an asynchronous timer.
......
......@@ -396,7 +396,7 @@ static void *DemuxThread( void *p_data )
vlc_restorecancel( p_sys->i_cancel_state );
}
mwait( i_next_frame_date );
vlc_tick_wait( i_next_frame_date );
i_next_frame_date += p_sys->i_frame_interval;
if ( i_ret >= 0 )
......
......@@ -281,7 +281,7 @@ static int Demux( demux_t *p_demux )
while( mdate() >= p_sys->i_next_date + p_sys->i_incr )
p_sys->i_next_date += p_sys->i_incr;
mwait( p_sys->i_next_date );
vlc_tick_wait( p_sys->i_next_date );
p_block = screen_Capture( p_demux );
if( !p_block )
{
......
......@@ -348,7 +348,7 @@ static void *DemuxThread( void *p_data )
/* Ensure we're not building frames too fast */
/* as WaitForMessage takes only a maximum wait */
mwait( i_next_frame_date );
vlc_tick_wait( i_next_frame_date );
i_next_frame_date += p_sys->i_frame_interval;
if ( i_status > 0 )
......
......@@ -425,7 +425,7 @@ static void* ThreadWrite( void *data )
i_to_send--;
if( !i_to_send || (p_pk->i_flags & BLOCK_FLAG_CLOCK) )
{
mwait( i_date );
vlc_tick_wait( i_date );
i_to_send = i_group;
}
if ( send( p_sys->i_handle, p_pk->p_buffer, p_pk->i_buffer, 0 ) == -1 )
......
......@@ -200,7 +200,7 @@ static int Demux(demux_t *demux)
if (deadline + max_wait < pts_first) {
es_out_SetPCR(demux->out, deadline);
/* That's ugly, but not yet easily fixable */
mwait(deadline + max_wait);
vlc_tick_wait(deadline + max_wait);
return VLC_DEMUXER_SUCCESS;
}
} else {
......
......@@ -403,7 +403,7 @@ static int MjpgDemux( demux_t *p_demux )
if( p_sys->b_still && p_sys->i_still_end )
{
/* Still frame, wait until the pause delay is gone */
mwait( p_sys->i_still_end );
vlc_tick_wait( p_sys->i_still_end );
p_sys->i_still_end = 0;
return VLC_DEMUXER_SUCCESS;
}
......
......@@ -684,7 +684,7 @@ static void *Run(void *data)
for (;;)
{
vlc_restorecancel(canc);
mwait(next_exchange);
vlc_tick_wait(next_exchange);
vlc_mutex_lock(&p_sys->lock);
mutex_cleanup_push(&p_sys->lock);
......
......@@ -1167,7 +1167,7 @@ static void* live_thread( void* p )
vlc_stream_Delete( download_stream );
}
mwait( last_dl_start_time + ( ((int64_t)hds_stream->fragment_runs[hds_stream->fragment_run_count-1].fragment_duration) * 1000000LL) / ((int64_t)hds_stream->afrt_timescale) );
vlc_tick_wait( last_dl_start_time + ( ((int64_t)hds_stream->fragment_runs[hds_stream->fragment_run_count-1].fragment_duration) * 1000000LL) / ((int64_t)hds_stream->afrt_timescale) );
}
......
......@@ -1425,12 +1425,12 @@ static void* ThreadSend( void *data )
out->i_buffer = len;
}
if (out)
mwait (out->i_dts + i_caching);
vlc_tick_wait (out->i_dts + i_caching);
vlc_cleanup_pop ();
if (out == NULL)
continue;
#else
mwait (out->i_dts + i_caching);
vlc_tick_wait (out->i_dts + i_caching);
vlc_cleanup_pop ();
#endif
......
......@@ -487,7 +487,7 @@ static void *Thread( void *p_data )
glPopMatrix();
/* Wait to swapp the frame on time. */
mwait(block->i_pts + (block->i_length / 2));
vlc_tick_wait(block->i_pts + (block->i_length / 2));
vlc_gl_Swap(gl);
release:
......
......@@ -373,7 +373,7 @@ static void *Thread( void *p_data )
p_projectm->renderFrame();
/* */
mwait( i_deadline );
vlc_tick_wait( i_deadline );
vlc_gl_Swap( gl );
}
......
......@@ -536,8 +536,8 @@ vlc_tick_t mdate (void)
return (d.quot * date) + ((d.rem * date) / denom);
}
#undef mwait
void mwait (vlc_tick_t deadline)
#undef vlc_tick_wait
void vlc_tick_wait (vlc_tick_t deadline)
{
deadline -= mdate ();
if (deadline > 0)
......
......@@ -1044,7 +1044,7 @@ static void *TsRun( void *p_data )
* reading */
vlc_cleanup_push( cmd_cleanup_routine, &cmd );
mwait( i_deadline );
vlc_tick_wait( i_deadline );
vlc_cleanup_pop();
......
......@@ -272,7 +272,7 @@ vlc_obj_calloc
vlc_obj_strdup
vlc_obj_free
msleep
mwait
vlc_tick_wait
net_Accept
net_AcceptSingle
net_Connect
......
......@@ -229,7 +229,7 @@ int vlc_mwait_i11e(vlc_tick_t deadline)
{
vlc_interrupt_t *ctx = vlc_interrupt_var;
if (ctx == NULL)
return mwait(deadline), 0;
return vlc_tick_wait(deadline), 0;
vlc_cond_t wait;
vlc_cond_init(&wait);
......
......@@ -80,7 +80,7 @@ static void vlc_cancel_addr_finish(void *addr)
#endif
#ifdef LIBVLC_NEED_SLEEP
void (mwait)(vlc_tick_t deadline)
void (vlc_tick_wait)(vlc_tick_t deadline)
{
vlc_tick_t delay;
atomic_int value = ATOMIC_VAR_INIT(0);
......@@ -98,7 +98,7 @@ void (mwait)(vlc_tick_t deadline)
void (msleep)(vlc_tick_t delay)
{
mwait(mdate() + delay);
vlc_tick_wait(mdate() + delay);
}
#endif
......
......@@ -913,8 +913,8 @@ vlc_tick_t mdate (void)
return (d.quot * CLOCK_FREQ) + ((d.rem * CLOCK_FREQ) / freq);
}
#undef mwait
void mwait (vlc_tick_t deadline)
#undef vlc_tick_wait
void vlc_tick_wait (vlc_tick_t deadline)
{
vlc_tick_t delay;
......@@ -932,7 +932,7 @@ void mwait (vlc_tick_t deadline)
#undef msleep
void msleep (vlc_tick_t delay)
{
mwait (mdate () + delay);
vlc_tick_wait (mdate () + delay);
}
/*** Timers ***/
......
......@@ -589,8 +589,8 @@ vlc_tick_t mdate (void)
return (INT64_C(1000000) * ts.tv_sec) + (ts.tv_nsec / 1000);
}
#undef mwait
void mwait (vlc_tick_t deadline)
#undef vlc_tick_wait
void vlc_tick_wait (vlc_tick_t deadline)
{
static pthread_once_t vlc_clock_once = PTHREAD_ONCE_INIT;
......
......@@ -1158,7 +1158,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
msg_Warn(vout, "picture is late (%lld ms)", delay / 1000);
#endif
if (!is_forced)
mwait(todisplay->date);
vlc_tick_wait(todisplay->date);
/* Display the direct buffer returned by vout_RenderPicture */
vout->p->displayed.date = mdate();
......
......@@ -777,7 +777,7 @@ vlc_tick_t mdate (void)
}
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
void (mwait)(vlc_tick_t deadline)
void (vlc_tick_wait)(vlc_tick_t deadline)
{
vlc_tick_t delay;
......@@ -795,7 +795,7 @@ void (mwait)(vlc_tick_t deadline)
void (msleep)(vlc_tick_t delay)
{
mwait (mdate () + delay);
vlc_tick_wait (mdate () + delay);
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment