X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_alarm.h;h=4012cd67ef6a4d657f29db29060e7ba416dc7e07;hb=0880c40113ef2d69b6433d7dfa0b4032cc378b0d;hp=16e4794ee3efcea4e120eceb38e72576271ad636;hpb=e9d48c0072d36eb6423b45fba4ec49d0def6c36f;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_alarm.h b/lib/librte_eal/common/include/rte_alarm.h index 16e4794ee3..4012cd67ef 100644 --- a/lib/librte_eal/common/include/rte_alarm.h +++ b/lib/librte_eal/common/include/rte_alarm.h @@ -1,13 +1,13 @@ /*- * BSD LICENSE - * + * * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -17,7 +17,7 @@ * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -76,7 +76,8 @@ typedef void (*rte_eal_alarm_callback)(void *arg); int rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb, void *cb_arg); /** - * Function to cancel an alarm callback which has been registered before. + * Function to cancel an alarm callback which has been registered before. If + * used outside alarm callback it wait for all callbacks to finish execution. * * @param cb_fn * alarm callback @@ -86,7 +87,14 @@ int rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb, void *cb_arg); * can be used here. * * @return - * - The number of callbacks removed + * - value greater than 0 and rte_errno not changed - returned value is + * the number of canceled alarm callback functions + * - value greater or equal 0 and rte_errno set to EINPROGRESS, at least one + * alarm could not be canceled because cancellation was requested from alarm + * callback context. Returned value is the number of succesfuly canceled + * alarm callbacks + * - 0 and rte_errno set to ENOENT - no alarm found + * - -1 and rte_errno set to EINVAL - invalid parameter (NULL callback) */ int rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn, void *cb_arg);