本文整理汇总了C++中LL_DELETE函数的典型用法代码示例。如果您正苦于以下问题:C++ LL_DELETE函数的具体用法?C++ LL_DELETE怎么用?C++ LL_DELETE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LL_DELETE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteAmaclList
void DeleteAmaclList(OicSecAmacl_t* amacl)
{
if (amacl)
{
OicSecAmacl_t *amaclTmp1 = NULL, *amaclTmp2 = NULL;
LL_FOREACH_SAFE(amacl, amaclTmp1, amaclTmp2)
{
unsigned int i = 0;
LL_DELETE(amacl, amaclTmp1);
// Clean Resources
for (i = 0; i < amaclTmp1->resourcesLen; i++)
{
OICFree(amaclTmp1->resources[i]);
}
OICFree(amaclTmp1->resources);
// Clean Amss
OICFree(amaclTmp1->amss);
// Clean Owners
OICFree(amaclTmp1->owners);
// Clean Amacl node itself
OICFree(amaclTmp1);
}
}
示例2: perf_free
Mavlink::~Mavlink()
{
perf_free(_loop_perf);
perf_free(_txerr_perf);
if (_task_running) {
/* task wakes up every 10ms or so at the longest */
_task_should_exit = true;
/* wait for a second for the task to quit at our request */
unsigned i = 0;
do {
/* wait 20ms */
usleep(20000);
/* if we have given up, kill it */
if (++i > 50) {
//TODO store main task handle in Mavlink instance to allow killing task
//task_delete(_mavlink_task);
break;
}
} while (_task_running);
}
if (_mavlink_instances) {
LL_DELETE(_mavlink_instances, this);
}
}
示例3: TWDeleteTWSock
TWResultCode TWDeleteTWSock(TWSock * sock)
{
if(!sock)
{
return TW_RESULT_ERROR_INVALID_PARAMS;
}
TWSock * out = NULL;
TWSock * tmp = NULL;
LL_FOREACH_SAFE(g_twSockList, out, tmp)
{
if(out == sock)
{
LL_DELETE(g_twSockList, out);
}
}
OICFree(sock->buffer);
OICFree(sock->eui);
TWFreeQueue(sock->plugin);
int mutexRet = pthread_mutex_destroy(&(sock->mutex));
if(mutexRet != 0)
{
OC_LOG_V(ERROR, TAG, "Failed to destroy mutex. Error: %d", mutexRet);
return TW_RESULT_ERROR;
}
TWResultCode result = TWCloseTWSock(sock);
return result;
}
示例4: profiler_start
void profiler_start(void)
{
profiler_block_t *b, *tmp;
LL_FOREACH_SAFE(g_blocks, b, tmp) {
b->count = b->tot_time = b->self_time = b->depth = 0;
LL_DELETE(g_blocks, b);
}
示例5: LL_FOREACH_SAFE
/**
* Invoke all pending actions prior to specified timestamp
*/
void EventQueue::executeAll(uint64_t now) {
scheduling_s * current, *tmp;
scheduling_s * executionList = NULL;
int counter = 0;
// we need safe iteration because we are removing elements inside the loop
LL_FOREACH_SAFE(head, current, tmp)
{
if (++counter > QUEUE_LENGTH_LIMIT) {
firmwareError("Is this list looped?");
return;
}
if (current->momentUs <= now) {
LL_DELETE(head, current);
LL_PREPEND(executionList, current);
}
}
/*
* we need safe iteration here because 'callback' might change change 'current->next'
* while re-inserting it into the queue from within the callback
*/
LL_FOREACH_SAFE(executionList, current, tmp)
current->callback(current->param);
}
示例6: lowlevel_scan_free
void lowlevel_scan_free()
{
if (!devinfo_list)
return;
struct lowlevel_device_info *info, *tmp;
struct lowlevel_device_info *info2, *tmp2;
LL_FOREACH_SAFE(devinfo_list, info, tmp)
{
LL_DELETE(devinfo_list, info);
LL_FOREACH_SAFE2(info, info2, tmp2, same_devid_next)
{
LL_DELETE(info, info2);
lowlevel_devinfo_free(info2);
}
示例7: destroyControlledLeds
ControlledLeds destroyControlledLeds(ControlledLeds leds) {
if (IsValid(leds)) {
LL_DELETE(controlled_leds, LEDS);
cleanUnderlyingLeds(leds);
free(LEDS);
}
return Invalid(ControlledLeds);
}
示例8: clear_list
void clear_list(struct fw_rule_node* list) {
struct fw_rule_node* curr;
LL_FOREACH(list, curr) {
LL_DELETE(list, curr);
free(curr->rule.name);
free(curr);
}
示例9: gnrc_netreg_unregister
void gnrc_netreg_unregister(gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
{
if (_INVALID_TYPE(type)) {
return;
}
LL_DELETE(netreg[type], entry);
}
示例10: reduceRefcount
static void reduceRefcount(LedList element) {
if (element->references > 0)
element->references--;
if (element->references == 0) {
LL_DELETE(underlying_leds, element);
free(element);
}
}
示例11: finalizeObject
static void finalizeObject(Env* env, Object* obj) {
// TRACEF("finalizeObject: %p (%s)\n", obj, obj->clazz->name);
rvmLockMutex(&referentsLock);
void* key = (void*) GC_HIDE_POINTER(obj);
ReferentEntry* referentEntry;
HASH_FIND_PTR(referents, &key, referentEntry);
assert(referentEntry != NULL);
if (referentEntry->references == NULL) {
// The object is not referenced by any type of reference and can never be resurrected.
HASH_DEL(referents, referentEntry);
rvmUnlockMutex(&referentsLock);
return;
}
Object* softReferences = NULL;
Object* weakReferences = NULL;
Object* finalizerReferences = NULL;
Object* phantomReferences = NULL;
Object* clearedReferences = NULL;
ReferenceList* refNode;
while (referentEntry->references != NULL) {
refNode = referentEntry->references;
LL_DELETE(referentEntry->references, refNode);
Object** list = NULL;
Object* reference = refNode->reference;
if (rvmIsSubClass(java_lang_ref_SoftReference, reference->clazz)) {
list = &softReferences;
} else if (rvmIsSubClass(java_lang_ref_WeakReference, reference->clazz)) {
list = &weakReferences;
} else if (rvmIsSubClass(java_lang_ref_FinalizerReference, reference->clazz)) {
list = &finalizerReferences;
} else if (rvmIsSubClass(java_lang_ref_PhantomReference, reference->clazz)) {
list = &phantomReferences;
}
enqueuePendingReference(env, reference, list);
}
assert(referentEntry->references == NULL);
clearAndEnqueueReferences(env, &softReferences, &clearedReferences);
clearAndEnqueueReferences(env, &weakReferences, &clearedReferences);
enqueueFinalizerReferences(env, &finalizerReferences, &clearedReferences);
clearAndEnqueueReferences(env, &phantomReferences, &clearedReferences);
// Reregister for finalization. If no new references have been added to the list of references for the referent the
// next time it gets finalized we know it will never be resurrected.
GC_REGISTER_FINALIZER_NO_ORDER(obj, _finalizeObject, NULL, NULL, NULL);
rvmUnlockMutex(&referentsLock);
if (clearedReferences != NULL) {
rvmCallVoidClassMethod(env, java_lang_ref_ReferenceQueue, java_lang_ref_ReferenceQueue_add, clearedReferences);
assert(rvmExceptionOccurred(env) == NULL);
}
}
示例12: close_modules
static void close_modules(module *list) {
module *m,*mt;
LL_FOREACH_SAFE(list,m,mt) {
LL_DELETE(list,m);
if (m->destroy != NULL) m->destroy();
dlclose(m->handle);
free(m);
}
示例13: free_pubsub_urls
void free_pubsub_urls()
{
struct pubsub_url *ps_url, *tmp;
LL_FOREACH_SAFE(pubsub_urls, ps_url, tmp) {
LL_DELETE(pubsub_urls, ps_url);
free(ps_url->address);
free(ps_url);
}
示例14: clear_rules
/* Clear rules loaded into memory */
void clear_rules()
{
rule * elt, *tmp;
/* delete each elemen using the safe iterator */
LL_FOREACH_SAFE(rules,elt,tmp) {
LL_DELETE(rules,elt);
free(elt->host);
free(elt);
}
示例15: ps2_command_alloc
struct ps2_async_command * ps2_command_alloc() {
struct ps2_async_command * cmd;
if(_ps2_free_commands) {
cmd = _ps2_free_commands;
LL_DELETE(_ps2_free_commands, cmd);
} else {
cmd = (struct ps2_async_command *)kmalloc(sizeof(struct ps2_async_command));
}
return cmd;
}