6 #include <boost/thread/thread.hpp>
7 #include <boost/thread/mutex.hpp>
9 #include <zypp/base/Logger.h>
10 #include <zypp/ZYpp.h>
11 #include <zypp/ZYppFactory.h>
13 #include "zypp/Product.h"
14 #include "zypp/Package.h"
16 #include "zypp/TmpPath.h"
18 #include "zypp/sat/Pool.h"
20 #include "zypp/PoolQuery.h"
24 using namespace zypp::repo;
26 bool result_cb( const ResObject::Ptr &r )
31 boost::mutex io_mutex;
35 Counter(int id) : id(id) { }
38 for (int i = 0; i < 10; ++i)
40 //boost::mutex::scoped_lock lock(io_mutex);
41 std::cout << id << ": " << i << std::endl;
44 boost::thread thrd2(Counter(3));
51 int main(int argc, char **argv)
55 ZYpp::Ptr z = getZYpp();
57 boost::thread thrd1(Counter(1));
58 boost::thread thrd2(Counter(2));
63 //z->initializeTarget("/");
64 //z->target()->load();
66 // sat::Pool::instance().addRepoSolv("./foo.solv");
68 // for ( ResPool::const_iterator it = z->pool().begin(); it != z->pool().end(); ++it )
70 // ResObject::constPtr res = it->resolvable();
71 // if ( res->name() == "kde4-kcolorchooser")
73 // cout << res << endl;
74 // cout << res->summary() << " | " << res->size() << endl;
79 catch ( const Exception &e )
82 cout << e.msg() << endl;