📄 spinlockinfo.cc
字号:
/* * spinlockinfo.{cc,hh} -- element stores spinlocks * Benjie Chen, Eddie Kohler * * Copyright (c) 2000 Massachusetts Institute of Technology * Copyright (c) 2008 Meraki, Inc. * * This software is being provided by the copyright holders under the GNU * General Public License, either version 2 or, at your discretion, any later * version. For more information, see the `COPYRIGHT' file in the source * distribution. */#include <click/config.h>#include "spinlockinfo.hh"#include <click/glue.hh>#include <click/confparse.hh>#include <click/nameinfo.hh>#include <click/error.hh>CLICK_DECLSSpinlockInfo::SpinlockInfo(){}SpinlockInfo::~SpinlockInfo(){}intSpinlockInfo::configure(Vector<String> &conf, ErrorHandler *errh){ int before = errh->nerrors(); if (NameDB *ndb = NameInfo::getdb(NameInfo::T_SPINLOCK, this, sizeof(Spinlock *), true)) { _spinlocks.reserve(conf.size()); String name; for (int i = 0; i < conf.size(); ++i) if (cp_string(conf[i], &name)) { _spinlocks.push_back(Spinlock()); Spinlock *spinptr = &_spinlocks.back(); ndb->define(name, &spinptr, sizeof(Spinlock *)); } else errh->error("bad NAME"); } else errh->error("out of memory!"); return (errh->nerrors() == before ? 0 : -1);}CLICK_ENDDECLSEXPORT_ELEMENT(SpinlockInfo)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -