[vlc-commits] input: convert item id to new atomic interface
Rémi Denis-Courmont
git at videolan.org
Sun May 13 19:28:06 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 13 19:56:35 2012 +0300| [c52e96aa4127335ab05fc67c9988948669c0a158] | committer: Rémi Denis-Courmont
input: convert item id to new atomic interface
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c52e96aa4127335ab05fc67c9988948669c0a158
---
src/input/item.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/input/item.c b/src/input/item.c
index 151e451..dff81ba 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -804,7 +804,7 @@ input_item_NewWithType( const char *psz_uri, const char *psz_name,
int i_options, const char *const *ppsz_options,
unsigned flags, mtime_t duration, int type )
{
- static vlc_atomic_t last_input_id = VLC_ATOMIC_INIT(0);
+ static atomic_int last_input_id = ATOMIC_VAR_INIT(0);
input_item_owner_t *owner = calloc( 1, sizeof( *owner ) );
if( unlikely(owner == NULL) )
@@ -813,7 +813,7 @@ input_item_NewWithType( const char *psz_uri, const char *psz_name,
input_item_t *p_input = &owner->item;
vlc_event_manager_t * p_em = &p_input->event_manager;
- p_input->i_id = vlc_atomic_inc(&last_input_id);
+ p_input->i_id = atomic_fetch_add(&last_input_id, 1);
vlc_gc_init( p_input, input_item_Destroy );
vlc_mutex_init( &p_input->lock );
More information about the vlc-commits
mailing list